From: Robert Phillips Date: Wed, 21 Dec 2016 00:05:09 +0000 (-0500) Subject: Handle failed surface creation in AlphaThresholdImageFilter GM X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~55^2~1091 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=253b4dd51fab530054bcf28a59341b4bd1622430;p=platform%2Fupstream%2FlibSkiaSharp.git 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 --- 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());