From ad224c6907e8a274f2679eae4c2e3085fdc7e8c8 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Sun, 22 Nov 2015 20:24:03 -0600 Subject: [PATCH] [libpng12] Fixed bug recently introduced in png_set_PLTE() that uses png_ptr not info_ptr. --- ANNOUNCE | 4 +++- CHANGES | 2 ++ pngset.c | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index f721f910..830c4cfd 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,5 +1,5 @@ -Libpng 1.2.55beta02 - November 22, 2015 +Libpng 1.2.55beta02 - November 23, 2015 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. @@ -48,6 +48,8 @@ version 1.2.55beta01 [November 20, 2015] png_handle_sPLT(), and png_handle_pCAL() (Bug report by John Regehr). version 1.2.55beta02 [%RDATE%] + Fixed bug recently introduced in png_set_PLTE() that uses png_ptr + not info_ptr. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index ab34336c..6aea426f 100644 --- a/CHANGES +++ b/CHANGES @@ -2899,6 +2899,8 @@ version 1.2.55beta01 [November 20, 2015] png_handle_sPLT(), and png_handle_pCAL() (Bug report by John Regehr). version 1.2.55beta02 [%RDATE%] + Fixed bug recently introduced in png_set_PLTE() that uses png_ptr + not info_ptr. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/pngset.c b/pngset.c index 03a0dce0..2e2285fd 100644 --- a/pngset.c +++ b/pngset.c @@ -456,8 +456,8 @@ png_set_PLTE(png_structp png_ptr, png_infop info_ptr, if (png_ptr == NULL || info_ptr == NULL) return; - max_palette_length = (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ? - (1 << png_ptr->bit_depth) : PNG_MAX_PALETTE_LENGTH; + max_palette_length = (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ? + (1 << info_ptr->bit_depth) : PNG_MAX_PALETTE_LENGTH; if (num_palette < 0 || num_palette > (int) max_palette_length) {