Bug 1336622 - Don't allow subnormal surfaceScale values to be used in the lighting filter calculations. r=jrmuizel, a=gchang/jcristau
authorMarkus Stange <mstange@themasta.com>
Thu, 09 Feb 2017 14:29:47 -0500
changeset 376122 c005b505ce54c9d4a30782f1a009f09ca4235a46
parent 376121 299aec2ab81eee998f3117531860e44a3468347f
child 376123 5ac03f489657296e2dd989c38e35c96f97d900c1
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, gchang, jcristau
bugs1336622
milestone53.0a2
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>