Index: gm/image_shader.cpp |
diff --git a/gm/image_shader.cpp b/gm/image_shader.cpp |
index 214b05d80cf3cf56e3716841311c05f97ecdda70..924199e6e7fcf0b3463d5b2acac134ce5fcb23ed 100644 |
--- a/gm/image_shader.cpp |
+++ b/gm/image_shader.cpp |
@@ -38,6 +38,9 @@ static sk_sp<SkImage> make_texture(GrContext* ctx, SkPicture* pic, const SkImage |
return nullptr; |
} |
auto surface(SkSurface::MakeRenderTarget(ctx, SkBudgeted::kNo, info)); |
+ if (!surface) { |
+ return nullptr; |
+ } |
surface->getCanvas()->clear(0); |
surface->getCanvas()->drawPicture(pic); |
return surface->makeImageSnapshot(); |