aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Kevin Lubick <kjlubick@google.com>2018-02-21 08:07:26 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-21 17:13:12 +0000
commit2388866c8de62a9f9422125e2df40a8cf21727c6 (patch)
tree575f293c17740a9fdfe6d7cfe711a5baff141dd4
parent5d32b83102a4477632f0bd360b3584a144329186 (diff)
Check for null colorFilter in FuzzCanvas
Follow up to https://skia-review.googlesource.com/c/skia/+/108300 Bug: skia: Change-Id: I1b8b6ff71c71388660e09b3a7e8c77a40b1a1d12 Reviewed-on: https://skia-review.googlesource.com/108960 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Kevin Lubick <kjlubick@google.com>
-rw-r--r--fuzz/FuzzCanvas.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/fuzz/FuzzCanvas.cpp b/fuzz/FuzzCanvas.cpp
index a14468f033..9e117af66f 100644
--- a/fuzz/FuzzCanvas.cpp
+++ b/fuzz/FuzzCanvas.cpp
@@ -183,7 +183,11 @@ static sk_sp<SkColorFilter> make_fuzz_colorfilter(Fuzz* fuzz, int depth) {
}
case 2: {
sk_sp<SkColorFilter> outer = make_fuzz_colorfilter(fuzz, depth - 1);
+ if (!outer) {
+ return nullptr;
+ }
sk_sp<SkColorFilter> inner = make_fuzz_colorfilter(fuzz, depth - 1);
+ // makeComposed should be able to handle nullptr.
return outer->makeComposed(std::move(inner));
}
case 3: {