diff --git a/layout/style/nsStyleContext.cpp b/layout/style/nsStyleContext.cpp index 626cef0d47ce..b6cf5aaa3e2c 100644 --- a/layout/style/nsStyleContext.cpp +++ b/layout/style/nsStyleContext.cpp @@ -1148,7 +1148,10 @@ nsStyleContext::CalcStyleDifferenceInternal(StyleContextLike* aNewContext, const nsStyleOutline *thisVisOutline = thisVis->StyleOutline(); const nsStyleOutline *otherVisOutline = otherVis->StyleOutline(); bool haveColor; - nscolor thisColor, otherColor; + // Dummy initialisations to keep Valgrind/Memcheck happy. + // See bug 1289098 comment 1. + nscolor thisColor = NS_RGBA(0, 0, 0, 0); + nscolor otherColor = NS_RGBA(0, 0, 0, 0); if (thisVisOutline->GetOutlineInitialColor() != otherVisOutline->GetOutlineInitialColor() || (haveColor = thisVisOutline->GetOutlineColor(thisColor)) != diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index b699c7729ddd..0f742845b7d8 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -3698,7 +3698,10 @@ nsStyleTextReset::CalcDifference(const nsStyleTextReset& aNewData) const } // Repaint for decoration color changes - nscolor decColor, otherDecColor; + // Dummy initialisations to keep Valgrind/Memcheck happy. + // See bug 1289098 comment 1. + nscolor decColor = NS_RGBA(0, 0, 0, 0); + nscolor otherDecColor = NS_RGBA(0, 0, 0, 0); bool isFG, otherIsFG; GetDecorationColor(decColor, isFG); aNewData.GetDecorationColor(otherDecColor, otherIsFG);