diff options
author | Ruben Brunk <rubenbrunk@google.com> | 2013-01-28 14:04:51 -0800 |
---|---|---|
committer | Ruben Brunk <rubenbrunk@google.com> | 2013-01-28 14:04:51 -0800 |
commit | 2dad62296f6b4c462b329c48b3bcc31cfdc56acc (patch) | |
tree | d371a6a1c1093515fa6a8753ae49306f5302ed38 | |
parent | 0203c47d888ed327c5df7d2233fc9ccb707d9725 (diff) | |
download | skia-2dad62296f6b4c462b329c48b3bcc31cfdc56acc.tar.gz |
This fixes the immediate setjmp crash.
Bug: 6880937
Change-Id: I13340705b7ae5050e00cd7fba56f21921de5a502
-rw-r--r-- | src/images/SkImageDecoder_libpng.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/images/SkImageDecoder_libpng.cpp b/src/images/SkImageDecoder_libpng.cpp index fa35239ffc..351b9cf119 100644 --- a/src/images/SkImageDecoder_libpng.cpp +++ b/src/images/SkImageDecoder_libpng.cpp @@ -439,6 +439,11 @@ bool SkPNGImageDecoder::onBuildTileIndex(SkStream* sk_stream, int *width, return false; } + if (setjmp(png_jmpbuf(png_ptr)) != 0) { + png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL); + return false; + } + int bit_depth, color_type, interlace_type; png_uint_32 origWidth, origHeight; png_get_IHDR(png_ptr, info_ptr, &origWidth, &origHeight, &bit_depth, |