[devel] Reset zlib datastream after detecting oversized compressed chunk

This commit is contained in:
Glenn Randers-Pehrson 2010-02-12 13:55:01 -06:00
parent 9b0956fed1
commit 4748a3346e

View File

@ -248,9 +248,13 @@ png_measure_decompressed_chunk(png_structp png_ptr, int comp_type,
if ((PNG_USER_CHUNK_MALLOC_MAX > 0) && if ((PNG_USER_CHUNK_MALLOC_MAX > 0) &&
text_size >= PNG_USER_CHUNK_MALLOC_MAX - 1) text_size >= PNG_USER_CHUNK_MALLOC_MAX - 1)
#endif #endif
{
inflateReset(&png_ptr->zstream);
png_ptr->zstream.avail_in = 0;
return 0; return 0;
} }
} }
}
if (ret == Z_STREAM_END) if (ret == Z_STREAM_END)
break; break;