From 39126d5707cacc9dce17c0b74417bf2643ae7c42 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Thu, 30 Jan 2014 15:37:05 -0600 Subject: [PATCH] [libpng12] Quiet an uninitialized memory warning from VC2013 in png_get_png(). --- ANNOUNCE | 37 ++++++++++++++++++++----------------- CHANGES | 3 +++ pngread.c | 16 +++++----------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index fd65b614..6e0db8c3 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,5 +1,5 @@ -Libpng 1.2.51rc01 - January 28, 2014 +Libpng 1.2.51rc02 - January 30, 2014 This is not intended to be a public release. It will be replaced within a few weeks by a public version or by another test version. @@ -9,36 +9,36 @@ Files available for download: Source files with LF line endings (for Unix/Linux) and with a "configure" script - libpng-1.2.51rc01.tar.xz (LZMA-compressed, recommended) - libpng-1.2.51rc01.tar.gz - libpng-1.2.51rc01.tar.bz2 + libpng-1.2.51rc02.tar.xz (LZMA-compressed, recommended) + libpng-1.2.51rc02.tar.gz + libpng-1.2.51rc02.tar.bz2 Source files with LF line endings (for Unix/Linux) without the "configure" script - libpng-1.2.51rc01-no-config.tar.xz (LZMA-compressed, recommended) - libpng-1.2.51rc01-no-config.tar.gz - libpng-1.2.51rc01-no-config.tar.bz2 + libpng-1.2.51rc02-no-config.tar.xz (LZMA-compressed, recommended) + libpng-1.2.51rc02-no-config.tar.gz + libpng-1.2.51rc02-no-config.tar.bz2 Source files with CRLF line endings (for Windows), without the "configure" script - lp1251r01.zip - lp1251r01.7z - lp1251r01.tar.bz2 + lp1251r02.zip + lp1251r02.7z + lp1251r02.tar.bz2 Project files - libpng-1.2.51rc01-project-netware.zip - libpng-1.2.51rc01-project-wince.zip + libpng-1.2.51rc02-project-netware.zip + libpng-1.2.51rc02-project-wince.zip Other information: - libpng-1.2.51rc01-README.txt - libpng-1.2.51rc01-KNOWNBUGS.txt - libpng-1.2.51rc01-LICENSE.txt - libpng-1.2.51rc01-Y2K-compliance.txt - libpng-1.2.51rc01-[previous version]-diff.txt + libpng-1.2.51rc02-README.txt + libpng-1.2.51rc02-KNOWNBUGS.txt + libpng-1.2.51rc02-LICENSE.txt + libpng-1.2.51rc02-Y2K-compliance.txt + libpng-1.2.51rc02-[previous version]-diff.txt Changes since the last public release (1.2.50): @@ -66,6 +66,9 @@ version 1.2.51beta05 [January 22, 2014] version 1.2.51rc01 [January 28, 2014] No changes. +version 1.2.51rc02 [January 30, 2014] + Quiet an uninitialized memory warning from VC2013 in png_get_png(). + (subscription required; visit https://lists.sourceforge.net/lists/listinfo/png-mng-implement to subscribe) or to glennrp at users.sourceforge.net diff --git a/CHANGES b/CHANGES index b20aad1f..dc311285 100644 --- a/CHANGES +++ b/CHANGES @@ -2801,6 +2801,9 @@ version 1.2.51beta05 [January 22, 2014] version 1.2.51rc01 [January 28, 2014] No changes. +version 1.2.51rc02 [January 30, 2014] + Quiet an uninitialized memory warning from VC2013 in png_get_png(). + Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit https://lists.sourceforge.net/lists/listinfo/png-mng-implement diff --git a/pngread.c b/pngread.c index 69ee464b..f0a54c1f 100644 --- a/pngread.c +++ b/pngread.c @@ -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 [%RDATE%] + * 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