aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/SkSLIRGenerator.cpp
diff options
context:
space:
mode:
authorGravatar ethannicholas <ethannicholas@google.com>2016-10-14 09:56:33 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-10-14 09:56:33 -0700
commit7effa7a29a04fb417c5e4abbe6aabf576a2aede0 (patch)
tree99198f5e8447ed269a2262ff91a022b41f8cf41b /src/sksl/SkSLIRGenerator.cpp
parentcce3e58f6660a77e1a6f93d8579a279a2450b0da (diff)
more SkSL fuzzer crash fixes
Diffstat (limited to 'src/sksl/SkSLIRGenerator.cpp')
-rw-r--r--src/sksl/SkSLIRGenerator.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/sksl/SkSLIRGenerator.cpp b/src/sksl/SkSLIRGenerator.cpp
index 9a42379065..b93cbfbe99 100644
--- a/src/sksl/SkSLIRGenerator.cpp
+++ b/src/sksl/SkSLIRGenerator.cpp
@@ -525,6 +525,9 @@ std::unique_ptr<InterfaceBlock> IRGenerator::convertInterfaceBlock(const ASTInte
std::unique_ptr<VarDeclarations> decl = this->convertVarDeclarations(
*intf.fDeclarations[i],
Variable::kGlobal_Storage);
+ if (!decl) {
+ return nullptr;
+ }
for (const auto& var : decl->fVars) {
fields.push_back(Type::Field(var.fVar->fModifiers, var.fVar->fName,
&var.fVar->fType));
@@ -1024,11 +1027,17 @@ std::unique_ptr<Expression> IRGenerator::convertConstructor(
int rows = args[i]->fType.rows();
args[i] = this->coerce(std::move(args[i]),
type.componentType().toCompound(fContext, columns, rows));
+ if (!args[i]) {
+ return nullptr;
+ }
actual += args[i]->fType.rows() * args[i]->fType.columns();
} else if (args[i]->fType.kind() == Type::kScalar_Kind) {
actual += 1;
if (type.kind() != Type::kScalar_Kind) {
args[i] = this->coerce(std::move(args[i]), type.componentType());
+ if (!args[i]) {
+ return nullptr;
+ }
}
} else {
fErrors.error(position, "'" + args[i]->fType.description() + "' is not a valid "