Clean up after longjmp in SkImageDecoder_libpng.
In onDecodeInit, if longjmp sends us back to setjmp, destroy the png_struct and info_ptr before returning false. Since the PNGAutoClean has not been created yet, we were previously leaking resources. R=djsollen@google.com Review URL: https://codereview.chromium.org/68453006 git-svn-id: http://skia.googlecode.com/svn/trunk@12244 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
f4dcea6020
commit
5401cd019b
@ -255,6 +255,7 @@ bool SkPNGImageDecoder::onDecodeInit(SkStream* sk_stream, png_structp *png_ptrp,
|
||||
* set up your own error handlers in the png_create_read_struct() earlier.
|
||||
*/
|
||||
if (setjmp(png_jmpbuf(png_ptr))) {
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user