Only access the scissorState's rect when it is valid
It is odd asan/valgrind hasn't been complaining about this
Change-Id: I8e7952e6fc554450ff8c5c5940500f09be48d6b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255144
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/ops/GrFillRRectOp.cpp b/src/gpu/ops/GrFillRRectOp.cpp
index 13e596b..0760808 100644
--- a/src/gpu/ops/GrFillRRectOp.cpp
+++ b/src/gpu/ops/GrFillRRectOp.cpp
@@ -746,8 +746,13 @@
initArgs.fDstProxyView = flushState->drawOpArgs().dstProxyView();
initArgs.fOutputSwizzle = flushState->drawOpArgs().outputSwizzle();
auto clip = flushState->detachAppliedClip();
- GrPipeline::FixedDynamicState* fixedDynamicState =
- flushState->allocator()->make<GrPipeline::FixedDynamicState>(clip.scissorState().rect());
+ GrPipeline::FixedDynamicState* fixedDynamicState = nullptr;
+
+ if (clip.scissorState().enabled()) {
+ fixedDynamicState = flushState->allocator()->make<GrPipeline::FixedDynamicState>(
+ clip.scissorState().rect());
+ }
+
GrPipeline* pipeline = flushState->allocator()->make<GrPipeline>(initArgs,
std::move(fProcessors),
std::move(clip));