Bug 1292378 - VerifyRGBXFormat has an incorrect width calculation. r=lsalzman
authorMason Chang <mchang@mozilla.com>
Fri, 05 Aug 2016 10:26:33 -0700
changeset 397515 6c4e3cb9d02be6a3e3a80848cadbae1d22d9224c
parent 397514 5ea439b8ccb891d50723cc91bf329c1bf9e38217
child 397516 fb4fa13ea19aa28010329f15aed7bd1dd0f5ee54
push id25332
push usermaglione.k@gmail.com
push dateSat, 06 Aug 2016 21:21:51 +0000
reviewerslsalzman
bugs1292378
milestone51.0a1
Bug 1292378 - VerifyRGBXFormat has an incorrect width calculation. r=lsalzman
gfx/2d/DrawTargetSkia.cpp
--- a/gfx/2d/DrawTargetSkia.cpp
+++ b/gfx/2d/DrawTargetSkia.cpp
@@ -108,17 +108,17 @@ static bool
 VerifyRGBXFormat(uint8_t* aData, const IntSize &aSize, const int32_t aStride, SurfaceFormat aFormat)
 {
   if (aFormat != SurfaceFormat::B8G8R8X8 || aSize.IsEmpty()) {
     return true;
   }
   // We should've initialized the data to be opaque already
   // On debug builds, verify that this is actually true.
   int height = aSize.height;
-  int width = aSize.width;
+  int width = aSize.width * 4;
 
   for (int row = 0; row < height; ++row) {
     for (int column = 0; column < width; column += 4) {
 #ifdef IS_BIG_ENDIAN
       MOZ_ASSERT(aData[column] == 0xFF);
 #else
       MOZ_ASSERT(aData[column + 3] == 0xFF);
 #endif