Bug 1298652 - Allow 64k width/height images to be rendered. r?jrmuizel draft
authorAndrew Osmond <aosmond@mozilla.com>
Thu, 01 Sep 2016 07:32:02 -0400
changeset 499223 00c752b19e289549900232afaedf94a2c49713e6
parent 498697 8dd496fd015a2b6e99573070279d9d1593836ea9
child 549285 93334f808ec3028c286620874f4bc230b5820932
push id49341
push userVYV03354@nifty.ne.jp
push dateWed, 15 Mar 2017 13:27:21 +0000
reviewersjrmuizel
bugs1298652
milestone55.0a1
Bug 1298652 - Allow 64k width/height images to be rendered. r?jrmuizel MozReview-Commit-ID: DIK9y9acV0M
image/imgFrame.cpp
image/test/reftest/downscaling/reftest.list
--- a/image/imgFrame.cpp
+++ b/image/imgFrame.cpp
@@ -151,24 +151,16 @@ AllowedImageSize(int32_t aWidth, int32_t
   }
 
   // check to make sure we don't overflow a 32-bit
   CheckedInt32 requiredBytes = CheckedInt32(aWidth) * CheckedInt32(aHeight) * 4;
   if (MOZ_UNLIKELY(!requiredBytes.isValid())) {
     NS_WARNING("width or height too large");
     return false;
   }
-#if defined(XP_MACOSX)
-  // CoreGraphics is limited to images < 32K in *height*, so clamp all surfaces
-  // on the Mac to that height
-  if (MOZ_UNLIKELY(aHeight > SHRT_MAX)) {
-    NS_WARNING("image too big");
-    return false;
-  }
-#endif
   return true;
 }
 
 static bool AllowedImageAndFrameDimensions(const nsIntSize& aImageSize,
                                            const nsIntRect& aFrameRect)
 {
   if (!AllowedImageSize(aImageSize.width, aImageSize.height)) {
     return false;
--- a/image/test/reftest/downscaling/reftest.list
+++ b/image/test/reftest/downscaling/reftest.list
@@ -188,20 +188,20 @@ fuzzy(18,128) == downscale-32px.html?.bm
 fuzzy(18,128) == downscale-32px.html?.gif downscale-32px-ref.html
 fuzzy(19,992) == downscale-32px.html?.jpg downscale-32px-ref.html
 fuzzy(18,128) == downscale-32px.html?.png downscale-32px-ref.html
 == downscale-32px.html?.svg downscale-32px-ref.html
 fuzzy(18,128) == downscale-32px.html?-bmp-in.ico downscale-32px-ref.html
 fuzzy(18,128) == downscale-32px.html?-png-in.ico downscale-32px-ref.html
 
 # Test images taller or wider than 32767 pixels.
-fails-if(OSX) == huge-1.html?100x32768.png,100,100 huge-1.html?100x100.png,100,100
-fails-if(OSX) == huge-1.html?100x32768.png,100,32768 huge-1.html?100x100.png,100,32768
+== huge-1.html?100x32768.png,100,100 huge-1.html?100x100.png,100,100
+== huge-1.html?100x32768.png,100,32768 huge-1.html?100x100.png,100,32768
 == huge-1.html?32768x100.png,100,100 huge-1.html?100x100.png,100,100
 == huge-1.html?32768x100.png,32768,100 huge-1.html?100x100.png,32768,100
-fails-if(OSX) == huge-1.html?100x32768.gif,100,100 huge-1.html?100x100.gif,100,100
-fails-if(OSX) == huge-1.html?100x32768.gif,100,32768 huge-1.html?100x100.gif,100,32768
+== huge-1.html?100x32768.gif,100,100 huge-1.html?100x100.gif,100,100
+== huge-1.html?100x32768.gif,100,32768 huge-1.html?100x100.gif,100,32768
 == huge-1.html?32768x100.gif,100,100 huge-1.html?100x100.gif,100,100
 == huge-1.html?32768x100.gif,32768,100 huge-1.html?100x100.gif,32768,100
-fails-if(OSX) == huge-1.html?100x32768.jpg,100,100 huge-1.html?100x100.jpg,100,100
-fails-if(OSX) == huge-1.html?100x32768.jpg,100,32768 huge-1.html?100x100.jpg,100,32768
+== huge-1.html?100x32768.jpg,100,100 huge-1.html?100x100.jpg,100,100
+== huge-1.html?100x32768.jpg,100,32768 huge-1.html?100x100.jpg,100,32768
 == huge-1.html?32768x100.jpg,100,100 huge-1.html?100x100.jpg,100,100
 == huge-1.html?32768x100.jpg,32768,100 huge-1.html?100x100.jpg,32768,100