Bug 1336622 - Don't allow subnormal surfaceScale values to be used in the lighting filter calculations. r=jrmuizel, a=gchang
authorMarkus Stange <mstange@themasta.com>
Thu, 09 Feb 2017 14:29:47 -0500
changeset 487460 4ba337cdb99836fd199034ae9958c2f522f7c6c6
parent 487459 381552c888b4a6146e78fa83ae886c01b40233e5
child 487461 db9b13748d736574a3fe6b8686a8dbafd9864b30
push id46228
push userpaul@paul.cx
push dateTue, 21 Feb 2017 16:19:44 +0000
reviewersjrmuizel, gchang
bugs1336622
milestone45.7.1
Bug 1336622 - Don't allow subnormal surfaceScale values to be used in the lighting filter calculations. r=jrmuizel, a=gchang MozReview-Commit-ID: LkmLX7zOfGe
gfx/2d/FilterNodeSoftware.cpp
--- a/gfx/2d/FilterNodeSoftware.cpp
+++ b/gfx/2d/FilterNodeSoftware.cpp
@@ -3300,17 +3300,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>