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

Unified Diff: third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp

Issue 2610183002: Adding null pointer check in BaseRenderingContext2D::restoreMatrixClipStack (Closed)
Patch Set: Created 3 years, 11 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: third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp
diff --git a/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp
index a551d487fba442dbeeca84f3536e108717e2d085..a97029554ca2c77b4184c7fd157d94e7547cffb4 100644
--- a/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp
@@ -98,10 +98,11 @@ void BaseRenderingContext2D::restoreMatrixClipStack(SkCanvas* c) const {
DCHECK(m_stateStack.begin() < m_stateStack.end());
for (currState = m_stateStack.begin(); currState < m_stateStack.end();
currState++) {
- CHECK(currState->get());
c->setMatrix(SkMatrix::I());
- currState->get()->playbackClips(c);
- c->setMatrix(affineTransformToSkMatrix(currState->get()->transform()));
+ if (currState->get()) {
+ currState->get()->playbackClips(c);
+ c->setMatrix(affineTransformToSkMatrix(currState->get()->transform()));
+ }
c->save();
}
c->restore();
« 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