commit | 19aa2b08678499a0d9c146bcd409a8f73f5e5d5c | [log] [tgz] |
---|---|---|
author | djsollen <djsollen@google.com> | Thu Jan 07 07:22:47 2016 -0800 |
committer | Commit bot <commit-bot@chromium.org> | Thu Jan 07 07:22:47 2016 -0800 |
tree | ee82232bb25e5de5e9aca5388a61398a95fb9966 | |
parent | 76a1225431947db80f343d64652a7db05496a029 [diff] [blame] |
Fix crash when ETC1 codec is not supported. BUG=skia:4216 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1567893002 Review URL: https://codereview.chromium.org/1567893002
diff --git a/gm/etc1bitmap.cpp b/gm/etc1bitmap.cpp index d9b08d1..e2f6c2d 100644 --- a/gm/etc1bitmap.cpp +++ b/gm/etc1bitmap.cpp
@@ -105,6 +105,10 @@ } SkAutoTUnref<SkImage> image(SkImage::NewFromEncoded(fileData)); + if (nullptr == image) { + SkDebugf("Could not decode the ETC file. ETC may not be included in this platform.\n"); + return; + } canvas->drawImage(image, 0, 0); }