aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrPipeline.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2016-11-17 10:22:48 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-17 17:34:13 +0000
commite60ad620fe236ce4c1e85a31bd53ed0c848da8c3 (patch)
tree99293fa57aeb9cf3887764c3ec2e8096421f6703 /src/gpu/GrPipeline.cpp
parent987de5b6b996ab19aac8e09fa030bbb35ed51a3b (diff)
Guard against instantiate & accessRenderTarget failures
Chrome's fuzzer have reminded me that, since we are deferring allocation, instantiate and accessRenderTarget can now fail further down the call stack. This should probably be cherry picked back to M56. BUG=665681,665500,665621 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4929 Change-Id: I44d81ff29586dfe75ddda30b5ed8ca76354542d6 Reviewed-on: https://skia-review.googlesource.com/4929 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrPipeline.cpp')
-rw-r--r--src/gpu/GrPipeline.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gpu/GrPipeline.cpp b/src/gpu/GrPipeline.cpp
index 872a7f544e..c0170eb703 100644
--- a/src/gpu/GrPipeline.cpp
+++ b/src/gpu/GrPipeline.cpp
@@ -23,7 +23,10 @@ GrPipeline* GrPipeline::CreateAt(void* memory, const CreateArgs& args,
const GrPipelineBuilder& builder = *args.fPipelineBuilder;
const GrUserStencilSettings* userStencil = builder.getUserStencil();
GrRenderTarget* rt = args.fRenderTargetContext->accessRenderTarget();
-
+ if (!rt) {
+ return nullptr;
+ }
+
GrPipeline* pipeline = new (memory) GrPipeline;
pipeline->fRenderTarget.reset(rt);
SkASSERT(pipeline->fRenderTarget);