From 15117f202c2e87483d391b3ff814d682137790b3 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Wed, 4 Nov 2015 23:45:44 -0600 Subject: [PATCH] [libpng15] Fixed new bug with CRC error after reading an over-length palette. --- pngrutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pngrutil.c b/pngrutil.c index 57ce699e8..5e10ba137 100644 --- a/pngrutil.c +++ b/pngrutil.c @@ -710,7 +710,7 @@ png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) #endif { - png_crc_finish(png_ptr, 0); + png_crc_finish(png_ptr, (int) length - num * 3); } #ifndef PNG_READ_OPT_PLTE_SUPPORTED