aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Brunk <rubenbrunk@google.com>2013-01-28 14:04:51 -0800
committerRuben Brunk <rubenbrunk@google.com>2013-01-28 14:04:51 -0800
commit2dad62296f6b4c462b329c48b3bcc31cfdc56acc (patch)
treed371a6a1c1093515fa6a8753ae49306f5302ed38
parent0203c47d888ed327c5df7d2233fc9ccb707d9725 (diff)
downloadskia-2dad62296f6b4c462b329c48b3bcc31cfdc56acc.tar.gz
This fixes the immediate setjmp crash.
Bug: 6880937 Change-Id: I13340705b7ae5050e00cd7fba56f21921de5a502
-rw-r--r--src/images/SkImageDecoder_libpng.cpp5
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,