Bug 726582 - Prevent nsSMILCSSProperty::ValueFromString from reading uninitialized out-param aPreventCachingOfSandwich. r=dholbert.

--HG--
extra : rebase_source : 1a766e42f4b3f323fcf5d4de4d3ba96be1ec8b15
This commit is contained in:
Jonathan Watt 2012-02-13 18:24:51 +00:00
parent 5f7e8936f8
commit 7b1efc19d1
3 changed files with 8 additions and 5 deletions

View File

@ -755,7 +755,7 @@ nsSMILAnimationFunction::ParseAttr(nsIAtom* aAttName,
{
nsAutoString attValue;
if (GetAttr(aAttName, attValue)) {
bool preventCachingOfSandwich;
bool preventCachingOfSandwich = false;
nsresult rv = aSMILAttr.ValueFromString(attValue, mAnimationElement,
aResult, preventCachingOfSandwich);
if (NS_FAILED(rv))
@ -796,7 +796,7 @@ nsSMILAnimationFunction::GetValues(const nsISMILAttr& aSMILAttr,
if (HasAttr(nsGkAtoms::values)) {
nsAutoString attValue;
GetAttr(nsGkAtoms::values, attValue);
bool preventCachingOfSandwich;
bool preventCachingOfSandwich = false;
nsresult rv = nsSMILParserUtils::ParseValues(attValue, mAnimationElement,
aSMILAttr, result,
preventCachingOfSandwich);

View File

@ -169,14 +169,17 @@ nsSMILCSSProperty::ValueFromString(const nsAString& aStr,
nsSMILCSSValueType::ValueFromString(mPropID, mElement, aStr, aValue,
&aPreventCachingOfSandwich);
if (aValue.IsNull()) {
return NS_ERROR_FAILURE;
}
// XXX Due to bug 536660 (or at least that seems to be the most likely
// culprit), when we have animation setting display:none on a <use> element,
// if we DON'T set the property every sample, chaos ensues.
if (!aPreventCachingOfSandwich && mPropID == eCSSProperty_display) {
aPreventCachingOfSandwich = true;
}
return aValue.IsNull() ? NS_ERROR_FAILURE : NS_OK;
return NS_OK;
}
nsresult

View File

@ -564,7 +564,7 @@ public:
virtual nsresult Parse(const nsAString& aValueStr) {
nsSMILValue newValue;
bool tmpPreventCachingOfSandwich;
bool tmpPreventCachingOfSandwich = false;
nsresult rv = mSMILAttr->ValueFromString(aValueStr, mSrcElement, newValue,
tmpPreventCachingOfSandwich);
if (NS_FAILED(rv))