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

Unified Diff: src/image/SkImage.cpp

Issue 2520043003: Handle nullptr from asTextureRef (Closed)
Patch Set: Created 4 years, 1 month 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: src/image/SkImage.cpp
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp
index f976242eca0086c037c2f4f333136ea3a69199ad..3487b7d92748596ecc9d0bdfaf80402b5e993a27 100644
--- a/src/image/SkImage.cpp
+++ b/src/image/SkImage.cpp
@@ -351,6 +351,9 @@ sk_sp<SkImage> SkImage::makeWithFilter(const SkImageFilter* filter, const SkIRec
if (result->isTextureBacked()) {
GrContext* context = result->getContext();
sk_sp<GrTexture> texture = result->asTextureRef(context);
+ if (!texture) {
+ return nullptr;
+ }
fullSize = SkIRect::MakeWH(texture->width(), texture->height());
}
#endif
« 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