Bug 334298 GetCSSFloatValue uses f uninitialized in a case that doesn't happen
r=glazou sr=neil
This commit is contained in:
@@ -75,7 +75,7 @@ static PRInt32 GetCSSFloatValue(nsIDOMCSSStyleDeclaration * aDecl,
|
|||||||
PRUint16 type;
|
PRUint16 type;
|
||||||
val->GetPrimitiveType(&type);
|
val->GetPrimitiveType(&type);
|
||||||
|
|
||||||
float f;
|
float f = 0;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case nsIDOMCSSPrimitiveValue::CSS_PX:
|
case nsIDOMCSSPrimitiveValue::CSS_PX:
|
||||||
// the value is in pixels, just get it
|
// the value is in pixels, just get it
|
||||||
@@ -89,14 +89,12 @@ static PRInt32 GetCSSFloatValue(nsIDOMCSSStyleDeclaration * aDecl,
|
|||||||
res = val->GetStringValue(str);
|
res = val->GetStringValue(str);
|
||||||
if (str.EqualsLiteral("thin"))
|
if (str.EqualsLiteral("thin"))
|
||||||
f = 1;
|
f = 1;
|
||||||
if (str.EqualsLiteral("medium"))
|
else if (str.EqualsLiteral("medium"))
|
||||||
f = 3;
|
f = 3;
|
||||||
if (str.EqualsLiteral("thick"))
|
else if (str.EqualsLiteral("thick"))
|
||||||
f = 5;
|
f = 5;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
f = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (PRInt32) f;
|
return (PRInt32) f;
|
||||||
|
|||||||
Reference in New Issue
Block a user