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

Unified Diff: third_party/WebKit/Source/core/animation/Animation.cpp

Issue 2961573002: Fix nullptr deref in InvalidateKeyframeEffect (Closed)
Patch Set: Created 3 years, 6 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
Index: third_party/WebKit/Source/core/animation/Animation.cpp
diff --git a/third_party/WebKit/Source/core/animation/Animation.cpp b/third_party/WebKit/Source/core/animation/Animation.cpp
index 355364e365b0103bb0452ffbc7abb170dfe8cb96..61c9aaa8901f4e286e1cb6e2aa45a9b148a67d1b 100644
--- a/third_party/WebKit/Source/core/animation/Animation.cpp
+++ b/third_party/WebKit/Source/core/animation/Animation.cpp
@@ -1167,12 +1167,14 @@ void Animation::InvalidateKeyframeEffect(const TreeScope& tree_scope) {
if (!content_ || !content_->IsKeyframeEffectReadOnly())
return;
- Element& target = *ToKeyframeEffectReadOnly(content_.Get())->Target();
+ Element* target = ToKeyframeEffectReadOnly(content_.Get())->Target();
- if (CSSAnimations::IsAffectedByKeyframesFromScope(target, tree_scope))
- target.SetNeedsStyleRecalc(kLocalStyleChange,
- StyleChangeReasonForTracing::Create(
- StyleChangeReason::kStyleSheetChange));
+ if (target &&
+ CSSAnimations::IsAffectedByKeyframesFromScope(*target, tree_scope)) {
alancutter (OOO until 2018) 2017/06/26 04:38:47 Please add a TODO to remove the use of CSSAnimatio
suzyh_UTC10 (ex-contributor) 2017/06/27 05:12:15 Done.
+ target->SetNeedsStyleRecalc(kLocalStyleChange,
+ StyleChangeReasonForTracing::Create(
+ StyleChangeReason::kStyleSheetChange));
+ }
}
void Animation::ResolvePromiseMaybeAsync(AnimationPromise* promise) {

Powered by Google App Engine
This is Rietveld 408576698