Bug 1580317. Fix calculation of buffer size. r=aosmond
authorTimothy Nikkel <tnikkel@gmail.com>
Wed, 25 Sep 2019 19:24:07 +0000
changeset 494982 4975f8c1003bf6a71844573954fde121abdd8b8b
parent 494981 39ac5d9d17943f9cfa8a4c6b8985757c5ff845b5
child 494983 7a5339ab7cb77e57bea6f9c246a33ece4879df8d
push id114131
push userdluca@mozilla.com
push dateThu, 26 Sep 2019 09:47:34 +0000
treeherdermozilla-inbound@1dc1a755079a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaosmond
bugs1580317
milestone71.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 1580317. Fix calculation of buffer size. r=aosmond Differential Revision: https://phabricator.services.mozilla.com/D47123
image/imgFrame.cpp
--- a/image/imgFrame.cpp
+++ b/image/imgFrame.cpp
@@ -82,17 +82,17 @@ static bool ShouldUseHeap(const IntSize&
   // For as long as an animated image is retained, its frames will never be
   // released to let the OS purge volatile buffers.
   if (aIsAnimated && StaticPrefs::image_mem_animated_use_heap()) {
     return true;
   }
 
   // Lets us avoid too many small images consuming all of the handles. The
   // actual allocation checks for overflow.
-  int32_t bufferSize = (aStride * aSize.width) / 1024;
+  int32_t bufferSize = (aStride * aSize.height) / 1024;
   if (bufferSize < StaticPrefs::image_mem_volatile_min_threshold_kb()) {
     return true;
   }
 
   return false;
 }
 
 static already_AddRefed<DataSourceSurface> AllocateBufferForImage(