Bug 869188 - Avoid mixing CheckedInt and float in Blur code - r=Bas
authorBenoit Jacob <bjacob@mozilla.com>
Tue, 07 May 2013 08:14:26 -0400
changeset 131172 a6934b3ae7cae9281983427cb9f43df4b45ee124
parent 131171 d571f60b80fddbc8026a9368960b8e3ba86cc5fb
child 131173 cff7378485bcfc4693ee192c71d16fece9101e92
push id24649
push userryanvm@gmail.com
push dateWed, 08 May 2013 02:10:32 +0000
treeherdermozilla-central@b980d32c366f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBas
bugs869188
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 869188 - Avoid mixing CheckedInt and float in Blur code - r=Bas
gfx/2d/Blur.cpp
--- a/gfx/2d/Blur.cpp
+++ b/gfx/2d/Blur.cpp
@@ -396,19 +396,22 @@ AlphaBoxBlur::AlphaBoxBlur(const Rect& a
                            float aSigma)
   : mRect(int32_t(aRect.x), int32_t(aRect.y),
           int32_t(aRect.width), int32_t(aRect.height)),
     mSpreadRadius(),
     mBlurRadius(CalculateBlurRadius(Point(aSigma, aSigma))),
     mStride(aStride),
     mSurfaceAllocationSize(-1)
 {
-  CheckedInt<int32_t> minDataSize = CheckedInt<int32_t>(aRect.width)*aRect.height;
-  if (minDataSize.isValid()) {
-    mSurfaceAllocationSize = minDataSize.value();
+  IntRect intRect;
+  if (aRect.ToIntRect(&intRect)) {
+    CheckedInt<int32_t> minDataSize = CheckedInt<int32_t>(intRect.width)*intRect.height;
+    if (minDataSize.isValid()) {
+      mSurfaceAllocationSize = minDataSize.value();
+    }
   }
 }
 
 
 AlphaBoxBlur::~AlphaBoxBlur()
 {
 }