diff options
Diffstat (limited to 'pngread.c')
-rw-r--r-- | pngread.c | 20 |
1 files changed, 7 insertions, 13 deletions
@@ -1,8 +1,8 @@ /* pngread.c - read a PNG file * - * Last changed in libpng 1.2.48 [March 8, 2012] - * Copyright (c) 1998-2012 Glenn Randers-Pehrson + * Last changed in libpng 1.2.51 [February 6, 2014] + * Copyright (c) 1998-2014 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -1405,7 +1405,7 @@ png_read_png(png_structp png_ptr, png_infop info_ptr, if (transforms & PNG_TRANSFORM_EXPAND) if ((png_ptr->bit_depth < 8) || (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) || - (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))) + (info_ptr->valid & PNG_INFO_tRNS)) png_set_expand(png_ptr); #endif @@ -1424,14 +1424,8 @@ png_read_png(png_structp png_ptr, png_infop info_ptr, * [0,65535] to the original [0,7] or [0,31], or whatever range the * colors were originally in: */ - if ((transforms & PNG_TRANSFORM_SHIFT) - && png_get_valid(png_ptr, info_ptr, PNG_INFO_sBIT)) - { - png_color_8p sig_bit; - - png_get_sBIT(png_ptr, info_ptr, &sig_bit); - png_set_shift(png_ptr, sig_bit); - } + if ((transforms & PNG_TRANSFORM_SHIFT) && (info_ptr->valid & PNG_INFO_sBIT)) + png_set_shift(png_ptr, &info_ptr->sig_bit); #endif #ifdef PNG_READ_BGR_SUPPORTED @@ -1506,8 +1500,8 @@ png_read_png(png_structp png_ptr, png_infop info_ptr, /* Read rest of file, and get additional chunks in info_ptr - REQUIRED */ png_read_end(png_ptr, info_ptr); - transforms = transforms; /* Quiet compiler warnings */ - params = params; + PNG_UNUSED(transforms) /* Quiet compiler warnings */ + PNG_UNUSED(params) } #endif /* PNG_INFO_IMAGE_SUPPORTED */ |