Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Unified Diff: src/gpu/GrClipMaskManager.cpp

Issue 957133002: Initialize three locals to avoid the risk of uninitialized reads. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrClipMaskManager.cpp
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index 99c74e3c3f5d09133e1da6b667c9e6452e24e886..424bd55ffda1cdaea6bcaa518ac9b475457aa032 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -216,10 +216,10 @@ bool GrClipMaskManager::setupClipping(GrPipelineBuilder* pipelineBuilder,
}
GrReducedClip::ElementList elements(16);
- int32_t genID;
- GrReducedClip::InitialState initialState;
+ int32_t genID = 0;
+ GrReducedClip::InitialState initialState = GrReducedClip::kAllIn_InitialState;
SkIRect clipSpaceIBounds;
- bool requiresAA;
+ bool requiresAA = false;
GrRenderTarget* rt = pipelineBuilder->getRenderTarget();
// GrDrawTarget should have filtered this for us
@@ -237,7 +237,6 @@ bool GrClipMaskManager::setupClipping(GrPipelineBuilder* pipelineBuilder,
// we should have handled this case above
SkASSERT(false);
case GrClip::kIRect_ClipType: {
- initialState = GrReducedClip::kAllIn_InitialState;
clipSpaceIBounds = clip.irect();
SkNEW_INSERT_AT_LLIST_HEAD(&elements,
Element,
@@ -245,7 +244,6 @@ bool GrClipMaskManager::setupClipping(GrPipelineBuilder* pipelineBuilder,
SkRegion::kIntersect_Op, false));
} break;
case GrClip::kRect_ClipType: {
- initialState = GrReducedClip::kAllIn_InitialState;
clipSpaceIBounds.setLTRB(SkScalarCeilToInt(clip.rect().fLeft),
SkScalarCeilToInt(clip.rect().fTop),
SkScalarCeilToInt(clip.rect().fRight),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698