Handle nullptr from asTextureRef
This can fail, if the special image dimensions are larger than the maximum
allowable render target dimensions.
BUG=chromium:666519
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2520043003
Review-Url: https://codereview.chromium.org/2520043003
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp
index 485bd24..e043681 100644
--- a/src/image/SkImage.cpp
+++ b/src/image/SkImage.cpp
@@ -352,6 +352,9 @@
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