From ff355004dd66ac0ccde291b78dc9b71ee24826e1 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Thu, 7 Jun 2012 09:56:30 -0500 Subject: [PATCH] [libpng15] Don't do the palette-index checking when num_palette is 0. --- ANNOUNCE | 5 +++-- CHANGES | 3 ++- pngtrans.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 6d56e5b48..81dfe48a0 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,5 +1,5 @@ -Libpng 1.5.11rc05 - June 6, 2012 +Libpng 1.5.11rc05 - June 7, 2012 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. @@ -57,7 +57,8 @@ Version 1.5.11rc03 [June 4, 2012] Version 1.5.11rc04 [June 6, 2012] Improved efficiency of new do_check_palette_indexes() function. -Version 1.5.11rc05 [June 6, 2012] +Version 1.5.11rc05 [June 7, 2012] + Don't check palette indexes if num_palette is 0 (as it can be in MNG files). Send comments/corrections/commendations to png-mng-implement at lists.sf.net: (subscription required; visit diff --git a/CHANGES b/CHANGES index ebd695f17..b4b471e22 100644 --- a/CHANGES +++ b/CHANGES @@ -3885,7 +3885,8 @@ Version 1.5.11rc03 [June 4, 2012] Version 1.5.11rc04 [June 6, 2012] Improved performance of new do_check_palette_indexes() function. -Version 1.5.11rc05 [June 6, 2012] +Version 1.5.11rc05 [June 7, 2012] + Don't check palette indexes if num_palette is 0 (as it can be in MNG files). Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/pngtrans.c b/pngtrans.c index 99c454446..7210d3250 100644 --- a/pngtrans.c +++ b/pngtrans.c @@ -626,7 +626,7 @@ void /* PRIVATE */ png_do_check_palette_indexes(png_structp png_ptr, png_row_infop row_info) { if (png_ptr->num_palette < (1 << row_info->bit_depth) && - png_ptr->num_palette_max >= 0) + png_ptr->num_palette > 0) /* num_palette can be 0 in MNG files */ { /* Calculations moved outside switch in an attempt to stop different * compiler warnings. 'padding' is in *bits* within the last byte, it is