Commit 1688fbc5 authored by Kevin Ellis's avatar Kevin Ellis Committed by Commit Bot

Fix property comparison in CSSAnimations.

Addresses regression introduced in:
https://chromium-review.googlesource.com/c/chromium/src/+/2369433

ComputedStyleUtils::ComputedPropertyValue can return a null value if
the value cannot be parsed, which leads to a potential null pointer
dereference.

Bug: 1126364
Change-Id: I31a74283a4cbfe9c6875fb9c832d6085ab21ae39
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2517044Reviewed-by: default avatarXida Chen <xidachen@chromium.org>
Commit-Queue: Kevin Ellis <kevers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#823978}
parent 2c6f7843
......@@ -525,9 +525,12 @@ bool ComputedValuesEqual(const PropertyHandle& property,
ComputedStyleUtils::ComputedPropertyValue(property.GetCSSProperty(), a);
const CSSValue* b_val =
ComputedStyleUtils::ComputedPropertyValue(property.GetCSSProperty(), b);
DCHECK(a_val);
DCHECK(b_val);
return *a_val == *b_val;
// Computed values can be null if not able to parse.
if (a_val && b_val)
return *a_val == *b_val;
// Fallback to the zoom-unaware comparator if either value could not be
// parsed.
return CSSPropertyEquality::PropertiesEqual(property, a, b);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment