From 253b4dd51fab530054bcf28a59341b4bd1622430 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Tue, 20 Dec 2016 19:05:09 -0500 Subject: [PATCH] Handle failed surface creation in AlphaThresholdImageFilter GM Change-Id: Ibc27d26a9afc1f88d5ca7de2216e09afa10ce846 Reviewed-on: https://skia-review.googlesource.com/6354 Reviewed-by: Robert Phillips Commit-Queue: Robert Phillips --- gm/imagealphathreshold.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gm/imagealphathreshold.cpp b/gm/imagealphathreshold.cpp index 302cdee..193423d 100644 --- a/gm/imagealphathreshold.cpp +++ b/gm/imagealphathreshold.cpp @@ -131,6 +131,9 @@ protected: sk_sp surface(make_color_matching_surface(canvas, WIDTH, HEIGHT, kPremul_SkAlphaType)); + if (!surface) { + return; + } surface->getCanvas()->clear(SK_ColorTRANSPARENT); draw_rects(surface->getCanvas()); -- 2.7.4