--- ./Amaya/thotlib/image/pnghandler.c.orig 2012-04-08 11:48:15.000000000 -0700 +++ ./Amaya/thotlib/image/pnghandler.c 2012-04-08 11:55:42.000000000 -0700 @@ -128,7 +128,7 @@ static unsigned char *ReadPng (FILE *pfF png_byte **ppbRowPointers; unsigned char *pixels; unsigned int i, j, passes; - unsigned long lw, lh; + png_uint_32 lw, lh; int iBitDepth, iColorType; double dGamma; @@ -175,7 +175,7 @@ static unsigned char *ReadPng (FILE *pfF png_set_palette_to_rgb (png_ptr); /* 8 bits / channel is needed */ if (iColorType == PNG_COLOR_TYPE_GRAY && iBitDepth < 8) - png_set_gray_1_2_4_to_8(png_ptr); + png_set_expand_gray_1_2_4_to_8(png_ptr); /* all transparency type : 1 color, indexed => alpha channel*/ if (png_get_valid (png_ptr, info_ptr,PNG_INFO_tRNS)) png_set_tRNS_to_alpha (png_ptr);