mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-24 19:37:15 +00:00
Bug 611927 - SVG SMIL: Fix assertion when attempting to add to NULL base value; r=dholbert; a=roc
This commit is contained in:
parent
05a66f777c
commit
6ab5ae8c8b
4
content/smil/crashtests/611927-1.svg
Normal file
4
content/smil/crashtests/611927-1.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<animate attributeName="stroke-width"/>
|
||||
<animate attributeName="stroke-width" by="10em"/>
|
||||
</svg>
|
After Width: | Height: | Size: 142 B |
@ -30,3 +30,4 @@ load 605345-1.svg
|
||||
load 606101-1.svg
|
||||
load 608549-1.svg
|
||||
load 608295-1.html
|
||||
load 611927-1.svg
|
||||
|
@ -246,6 +246,14 @@ nsSMILAnimationFunction::ComposeResult(const nsISMILAttr& aSMILAttr,
|
||||
mSimpleDuration.IsIndefinite() || mLastValue,
|
||||
"Unresolved simple duration for active or frozen animation");
|
||||
|
||||
// If we want to add but don't have a base value then just fail outright.
|
||||
// This can happen when we skipped getting the base value because there's an
|
||||
// animation function in the sandwich that should replace it but that function
|
||||
// failed unexpectedly.
|
||||
PRBool isAdditive = IsAdditive();
|
||||
if (isAdditive && aResult.IsNull())
|
||||
return;
|
||||
|
||||
nsSMILValue result;
|
||||
|
||||
if (mSimpleDuration.IsIndefinite() ||
|
||||
@ -286,7 +294,7 @@ nsSMILAnimationFunction::ComposeResult(const nsISMILAttr& aSMILAttr,
|
||||
}
|
||||
|
||||
// If additive animation isn't required or isn't supported, set the value.
|
||||
if (!IsAdditive() || NS_FAILED(aResult.SandwichAdd(result))) {
|
||||
if (!isAdditive || NS_FAILED(aResult.SandwichAdd(result))) {
|
||||
aResult.Swap(result);
|
||||
// Note: The old value of aResult is now in |result|, and it will get
|
||||
// cleaned up when |result| goes out of scope, when this function returns.
|
||||
|
Loading…
x
Reference in New Issue
Block a user