Bug 1336622 - Don't allow subnormal surfaceScale values to be used in the lighting filter calculations. r=jrmuizel, a=gchang/jcristau FIREFOX_52_0b6_BUILD1 FIREFOX_52_0b6_RELEASE
authorMarkus Stange <mstange@themasta.com>
Thu, 09 Feb 2017 14:29:47 -0500
changeset 484643 7b8aa893944b94d35e47314e52e0abff576c5ce2
parent 484642 8e853e2c67d149fc4dcc289298b7f133bafb04c2
child 484644 a537b707d7d2413de5c35f5effa02826eb3c61e9
push id45533
push userbsmedberg@mozilla.com
push dateWed, 15 Feb 2017 16:52:16 +0000
reviewersjrmuizel, gchang, jcristau
bugs1336622
milestone52.0
Bug 1336622 - Don't allow subnormal surfaceScale values to be used in the lighting filter calculations. r=jrmuizel, a=gchang/jcristau MozReview-Commit-ID: LkmLX7zOfGe
gfx/2d/FilterNodeSoftware.cpp
--- a/gfx/2d/FilterNodeSoftware.cpp
+++ b/gfx/2d/FilterNodeSoftware.cpp
@@ -3311,17 +3311,17 @@ FilterNodeLightingSoftware<LightType, Li
 {
   if (mLight.SetAttribute(aIndex, aValue) ||
       mLighting.SetAttribute(aIndex, aValue)) {
     Invalidate();
     return;
   }
   switch (aIndex) {
     case ATT_LIGHTING_SURFACE_SCALE:
-      mSurfaceScale = aValue;
+      mSurfaceScale = std::fpclassify(aValue) == FP_SUBNORMAL ? 0.0 : aValue;
       break;
     default:
       MOZ_CRASH("GFX: FilterNodeLightingSoftware::SetAttribute float");
   }
   Invalidate();
 }
 
 template<typename LightType, typename LightingType>