[trunk] remove warnings from jp2k decoder

This commit is contained in:
Mathieu Malaterre 2012-03-26 16:00:26 +00:00
parent 91ee6ed60f
commit 3a3820bedc
1 changed files with 8 additions and 4 deletions

View File

@ -31,6 +31,8 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include "jp2k_decoder.h" #include "jp2k_decoder.h"
#include "openjpeg.h" #include "openjpeg.h"
@ -158,8 +160,8 @@ void info_callback(const char *msg, void *client_data) {
Byte_t * imagetopnm(opj_image_t *image, ihdrbox_param_t **ihdrbox) Byte_t * imagetopnm(opj_image_t *image, ihdrbox_param_t **ihdrbox)
{ {
int adjustR, adjustG=0, adjustB=0; OPJ_UINT32 adjustR, adjustG=0, adjustB=0;
int datasize; OPJ_SIZE_T datasize;
Byte_t *pix=NULL, *ptr=NULL; Byte_t *pix=NULL, *ptr=NULL;
OPJ_UINT32 i; OPJ_UINT32 i;
@ -180,8 +182,10 @@ Byte_t * imagetopnm(opj_image_t *image, ihdrbox_param_t **ihdrbox)
*ihdrbox = (ihdrbox_param_t *)malloc( sizeof(ihdrbox_param_t)); *ihdrbox = (ihdrbox_param_t *)malloc( sizeof(ihdrbox_param_t));
(*ihdrbox)->width = image->comps[0].w; (*ihdrbox)->width = image->comps[0].w;
(*ihdrbox)->height = image->comps[0].h; (*ihdrbox)->height = image->comps[0].h;
(*ihdrbox)->bpc = image->comps[0].prec; assert( image->comps[0].prec < 256 );
(*ihdrbox)->nc = image->numcomps; (*ihdrbox)->bpc = (Byte_t)image->comps[0].prec;
assert( image->numcomps < USHRT_MAX );
(*ihdrbox)->nc = (Byte2_t)image->numcomps;
} }
datasize = (image->numcomps)*(image->comps[0].w)*(image->comps[0].h); datasize = (image->numcomps)*(image->comps[0].w)*(image->comps[0].h);