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

Unified Diff: cc/trees/property_tree.cc

Issue 2794673002: cc: Avoid Crash in Effect Tree Animation by Element ID (Closed)
Patch Set: fix compile error w/ no return value Created 3 years, 9 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: cc/trees/property_tree.cc
diff --git a/cc/trees/property_tree.cc b/cc/trees/property_tree.cc
index ab426546edbf1bac2b285b4b012b2ad81ce16868..bc4e7363f9f726b8d9340df9c80a951cc741e416 100644
--- a/cc/trees/property_tree.cc
+++ b/cc/trees/property_tree.cc
@@ -863,6 +863,11 @@ EffectNode* EffectTree::FindNodeFromElementId(ElementId id) {
bool EffectTree::OnOpacityAnimated(ElementId id, float opacity) {
EffectNode* node = FindNodeFromElementId(id);
DCHECK(node);
+ // TODO(crbug.com/706766): Avoid crash. Need more investigation for what is
+ // calling this without setting element id.
+ if (!node)
+ return false;
+
if (node->opacity == opacity)
return false;
node->opacity = opacity;
@@ -876,6 +881,11 @@ bool EffectTree::OnFilterAnimated(ElementId id,
const FilterOperations& filters) {
EffectNode* node = FindNodeFromElementId(id);
DCHECK(node);
+ // TODO(crbug.com/706766): Avoid crash. Need more investigation for what is
+ // calling this without setting element id.
+ if (!node)
+ return false;
+
if (node->filters == filters)
return false;
node->filters = filters;
« 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