commit | 71a56180e54de5ffa42b7e85835c272771393add | [log] [tgz] |
---|---|---|
author | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | Tue Aug 01 21:42:16 2017 -0500 |
committer | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | Tue Aug 01 21:42:16 2017 -0500 |
tree | edb8cf7b2b56dab3295bbc3ed9b36cb4fe785fa5 | |
parent | cb628b2e4ea33ab3041076f7e03e68678f02f12b [diff] [blame] |
[libpng16] Stop memory leak when returning from png_handle_eXIf() with an error (Bug report from the OSS-fuzz project).
diff --git a/pngset.c b/pngset.c index d62ac43..55a0e5c 100644 --- a/pngset.c +++ b/pngset.c
@@ -146,7 +146,11 @@ if (png_ptr == NULL || info_ptr == NULL) return; - png_free_data(png_ptr, info_ptr, PNG_FREE_EXIF, 0); + if (info_ptr->exif) + { + png_free(png_ptr, info_ptr->exif); + info_ptr->exif = NULL; + } info_ptr->num_exif = num_exif;