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

Unified Diff: third_party/WebKit/Source/platform/graphics/BitmapImage.cpp

Issue 2906583003: Add null checks of GetImageObserver() in BitmapImage (Closed)
Patch Set: Created 3 years, 7 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/platform/graphics/BitmapImage.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp b/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
index de68c82b52646e7fee938fad1a848c70ef5cf684..7e6ca635ef63af01b6d6daaa8e4590e6a95d6b37 100644
--- a/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
+++ b/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
@@ -604,6 +604,9 @@ bool BitmapImage::InternalAdvanceAnimation(AnimationAdvancement advancement) {
// Stop the animation.
StopAnimation();
+ if (!GetImageObserver())
+ return false;
+
// See if anyone is still paying attention to this animation. If not, we
// don't advance, and will remain suspended at the current frame until the
// animation is resumed.
@@ -654,7 +657,8 @@ bool BitmapImage::InternalAdvanceAnimation(AnimationAdvancement advancement) {
}
void BitmapImage::NotifyObserversOfAnimationAdvance(TimerBase*) {
- GetImageObserver()->AnimationAdvanced(this);
+ if (GetImageObserver())
+ GetImageObserver()->AnimationAdvanced(this);
}
} // namespace blink
« 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