aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2018-03-28 13:36:02 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-28 18:02:24 +0000
commitaa5da735fa27cdb60f55f94bbd2149727c9c0728 (patch)
treecabe284cba4765ae7e225c7f40c70a80cbc1d4cd /tools
parente47f0a0f1646ad31e0aeefd40a2cb1e1d275d18c (diff)
Check that paint is not null in OveridePaintFilterCanvas.
SkCanvas::drawPicture may provide nullptr for a paint. BUG=skia:7756 Change-Id: I46651f7e8f0d859a7e75206d93ed1f3b3c0a4bac Reviewed-on: https://skia-review.googlesource.com/116902 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/viewer/Viewer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp
index 8aff1cedb0..f4b03065e2 100644
--- a/tools/viewer/Viewer.cpp
+++ b/tools/viewer/Viewer.cpp
@@ -868,6 +868,9 @@ public:
: SkPaintFilterCanvas(canvas), fPaint(paint), fPaintOverrides(fields)
{ }
bool onFilter(SkTCopyOnFirstWrite<SkPaint>* paint, Type) const override {
+ if (*paint == nullptr) {
+ return true;
+ }
if (fPaintOverrides->fHinting) {
paint->writable()->setHinting(fPaint->getHinting());
}