pngdec: fix type conversion warnings

Change-Id: I1719cbed4521b492d3504a8a478cdd395060d43e
This commit is contained in:
James Zern 2015-09-25 18:43:01 -07:00
parent bef8e97d5d
commit c4c3cf2d0e

View File

@ -131,8 +131,8 @@ static int ExtractMetadataFromPNG(png_structp png,
for (p = 0; p < 2; ++p) { for (p = 0; p < 2; ++p) {
png_infop const info = (p == 0) ? head_info : end_info; png_infop const info = (p == 0) ? head_info : end_info;
png_textp text = NULL; png_textp text = NULL;
const int num = png_get_text(png, info, &text, NULL); const png_uint_32 num = png_get_text(png, info, &text, NULL);
int i; png_uint_32 i;
// Look for EXIF / XMP metadata. // Look for EXIF / XMP metadata.
for (i = 0; i < num; ++i, ++text) { for (i = 0; i < num; ++i, ++text) {
int j; int j;
@ -199,7 +199,7 @@ int ReadPNG(FILE* in_file, WebPPicture* const pic, int keep_alpha,
int p; int p;
int ok = 0; int ok = 0;
png_uint_32 width, height, y; png_uint_32 width, height, y;
int stride; png_uint_32 stride;
uint8_t* volatile rgb = NULL; uint8_t* volatile rgb = NULL;
png = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0); png = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0);
@ -268,11 +268,11 @@ int ReadPNG(FILE* in_file, WebPPicture* const pic, int keep_alpha,
goto Error; goto Error;
} }
pic->width = width; pic->width = (int)width;
pic->height = height; pic->height = (int)height;
pic->use_argb = 1; pic->use_argb = 1;
ok = has_alpha ? WebPPictureImportRGBA(pic, rgb, stride) ok = has_alpha ? WebPPictureImportRGBA(pic, rgb, (int)stride)
: WebPPictureImportRGB(pic, rgb, stride); : WebPPictureImportRGB(pic, rgb, (int)stride);
if (!ok) { if (!ok) {
goto Error; goto Error;