[libpng16] Restored part of ~PngObjectHandler() that was deleted from

contrib/oss-fuzz/libpng_read_fuzzer.cc
This commit is contained in:
Glenn Randers-Pehrson 2017-09-02 16:13:15 -05:00
parent 84a5bf83ff
commit dcd3edaf87

View File

@ -36,6 +36,16 @@ struct PngObjectHandler {
BufState* buf_state = nullptr;
~PngObjectHandler() {
if (png_handler.row_ptr)
png_free(png_handler.png_ptr, png_handler.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);
else if (png_handler.info_ptr)
png_destroy_read_struct(&png_handler.png_ptr, &png_handler.info_ptr,
nullptr);
else
png_destroy_read_struct(&png_handler.png_ptr, nullptr, nullptr);
delete buf_state;
}
};