Add null checks for GrSkSLtoGLSL to GrGLProgramBuilder
Bug: chromium:845351
Change-Id: I06c4114f9b2cd0609fcf7b7ce6d4a80a00ca85c3
Reviewed-on: https://skia-review.googlesource.com/131525
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index 4ffc1ec..071a091 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -195,6 +195,10 @@
fFS.fCompilerStrings.count(),
settings,
&glsl);
+ if (!fs) {
+ this->cleanupProgram(programID, shadersToDelete);
+ return nullptr;
+ }
inputs = fs->fInputs;
if (inputs.fRTHeight) {
this->addRTHeightUniform(SKSL_RTHEIGHT_NAME);
@@ -213,9 +217,9 @@
fVS.fCompilerStrings.count(),
settings,
&glsl);
- if (!this->compileAndAttachShaders(glsl.c_str(), glsl.size(), programID,
- GR_GL_VERTEX_SHADER, &shadersToDelete, settings,
- inputs)) {
+ if (!vs || !this->compileAndAttachShaders(glsl.c_str(), glsl.size(), programID,
+ GR_GL_VERTEX_SHADER, &shadersToDelete, settings,
+ inputs)) {
this->cleanupProgram(programID, shadersToDelete);
return nullptr;
}
@@ -238,13 +242,12 @@
fGS.fCompilerStrings.count(),
settings,
&glsl);
- if (!this->compileAndAttachShaders(glsl.c_str(), glsl.size(), programID,
- GR_GL_GEOMETRY_SHADER, &shadersToDelete, settings,
- inputs)) {
+ if (!gs || !this->compileAndAttachShaders(glsl.c_str(), glsl.size(), programID,
+ GR_GL_GEOMETRY_SHADER, &shadersToDelete,
+ settings, inputs)) {
this->cleanupProgram(programID, shadersToDelete);
return nullptr;
}
-
}
this->bindProgramResourceLocations(programID);