Bug 1259285 - Part3. Modified nsSMILCSSValueType::PropertyFromValue for prevent invalid nsSMILValue. r?birtles.
MozReview-Commit-ID: 9EzP1yTdXS8
--- a/dom/smil/nsSMILCSSValueType.cpp
+++ b/dom/smil/nsSMILCSSValueType.cpp
@@ -428,15 +428,19 @@ nsSMILCSSValueType::ValueToString(const
StyleAnimationValue::UncomputeValue(wrapper->mPropID,
wrapper->mCSSValue, aString);
}
// static
nsCSSProperty
nsSMILCSSValueType::PropertyFromValue(const nsSMILValue& aValue)
{
+ if (aValue.mType != &nsSMILCSSValueType::sSingleton) {
+ return eCSSProperty_UNKNOWN;
+ }
+
const ValueWrapper* wrapper = ExtractValueWrapper(aValue);
if (!wrapper) {
return eCSSProperty_UNKNOWN;
}
return wrapper->mPropID;
}