Bug 1432678. Convert to size_t in DecodedSurfaceProvider::LogicalSizeInBytes so multiplication doesn't overflow. r=aosmond
authorTimothy Nikkel <tnikkel@gmail.com>
Wed, 07 Feb 2018 17:00:04 -0600
changeset 457881 dff22255b582c72ad2a46f09d10b4410029a3e2a
parent 457880 5ee280615e4527c80642164d2d092bbaa36bd215
child 457882 3509bf5962d123b1ae2064979523f8b567e4847a
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaosmond
bugs1432678
milestone60.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 1432678. Convert to size_t in DecodedSurfaceProvider::LogicalSizeInBytes so multiplication doesn't overflow. r=aosmond
image/DecodedSurfaceProvider.cpp
--- a/image/DecodedSurfaceProvider.cpp
+++ b/image/DecodedSurfaceProvider.cpp
@@ -117,17 +117,17 @@ DecodedSurfaceProvider::SetLocked(bool a
                      : DrawableFrameRef();
 }
 
 size_t
 DecodedSurfaceProvider::LogicalSizeInBytes() const
 {
   // Single frame images are always 32bpp.
   IntSize size = GetSurfaceKey().Size();
-  return size.width * size.height * sizeof(uint32_t);
+  return size_t(size.width) * size_t(size.height) * sizeof(uint32_t);
 }
 
 void
 DecodedSurfaceProvider::Run()
 {
   MutexAutoLock lock(mMutex);
 
   if (!mDecoder || !mImage) {