Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 3bf3b92

Browse files
brianosmanSkia Commit-Bot
authored andcommitted
Guard runtime shader/colorfilter against SkSL that doesn't compile
Bug: oss-fuzz:20555 Bug: chromium:1051911 Change-Id: If40137e6cf3c0d398a86023c2399ddb7df10e209 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270442 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Kevin Lubick <kjlubick@google.com> Auto-Submit: Brian Osman <brianosman@google.com>
1 parent 1d1333f commit 3bf3b92

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/core/SkColorFilter.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,10 @@ sk_sp<SkFlattenable> SkRuntimeColorFilter::CreateProc(SkReadBuffer& buffer) {
491491
}
492492

493493
auto effect = std::get<0>(SkRuntimeEffect::Make(std::move(sksl)));
494+
if (!effect) {
495+
return nullptr;
496+
}
497+
494498
return effect->makeColorFilter(std::move(inputs), children.data(), children.size());
495499
}
496500

src/shaders/SkRTShader.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ sk_sp<SkFlattenable> SkRTShader::CreateProc(SkReadBuffer& buffer) {
117117
}
118118

119119
auto effect = std::get<0>(SkRuntimeEffect::Make(std::move(sksl)));
120+
if (!effect) {
121+
return nullptr;
122+
}
123+
120124
return effect->makeShader(std::move(inputs), children.data(), children.size(), localMPtr,
121125
isOpaque);
122126
}

0 commit comments

Comments
 (0)