[libpng16] Another whack at png_handle_sPLT() pointer calculation.

This commit is contained in:
John Bowler 2015-11-19 20:44:07 -06:00 committed by Glenn Randers-Pehrson
parent 4db6127658
commit 1ceedd0bf6

View File

@ -1670,7 +1670,7 @@ png_handle_sPLT(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
++entry_start;
/* A sample depth should follow the separator, and we should be on it */
if (length < 2 || entry_start - buffer > length - 2)
if (length < 2 || entry_start > buffer + (length - 2U))
{
png_warning(png_ptr, "malformed sPLT chunk");
return;