[libpng16] Free row_ptr in contrib/oss-fuzz/libpng_read_fuzzer.cc PNG_CLEANUP

to fix google/oss-fuzz issue 3193.
This commit is contained in:
Glenn Randers-Pehrson 2017-08-28 11:07:10 -05:00
parent 5c616548a0
commit ef76b1f688

View File

@ -26,6 +26,8 @@
#define PNG_CLEANUP \
if(png_handler.png_ptr) \
{ \
if (row_ptr && png_ptr) \
png_free(png_ptr, row_ptr); \
if (png_handler.end_info_ptr) \
png_destroy_read_struct(&png_handler.png_ptr, &png_handler.info_ptr,\
&png_handler.end_info_ptr); \
@ -49,9 +51,6 @@ struct PngObjectHandler {
BufState* buf_state = nullptr;
~PngObjectHandler() {
if (row_ptr && png_ptr) {
png_free(png_ptr, row_ptr);
}
PNG_CLEANUP
delete buf_state;
}