Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: gm/etc1bitmap.cpp

Issue 1567893002: Fix crash when ETC1 codec is not supported. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: better comment Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/etc1bitmap.cpp
diff --git a/gm/etc1bitmap.cpp b/gm/etc1bitmap.cpp
index d9b08d1e8642c34af15f84f2ab1546d9583ee950..e2f6c2dc41b586fe955253366cedfee4f75a0416 100644
--- a/gm/etc1bitmap.cpp
+++ b/gm/etc1bitmap.cpp
@@ -105,6 +105,10 @@ protected:
}
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);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698