Bug 1117304 - Also do the checks at the start of CopyRect in release builds. r=Bas, a=sledru
authorMarkus Stange <mstange@themasta.com>
Tue, 06 Jan 2015 12:08:39 +0100
changeset 249425 014e3858e10690a1ae6d46fe1ce095aa07db0b81
parent 249424 d077aaf352ea3af84d065479d25c6860cbab8c87
child 249426 94ff84d3339e128d8ff59d3e9d72f03ee0610d61
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBas, sledru
bugs1117304
milestone37.0a2
Bug 1117304 - Also do the checks at the start of CopyRect in release builds. r=Bas, a=sledru
gfx/2d/DataSurfaceHelpers.cpp
--- a/gfx/2d/DataSurfaceHelpers.cpp
+++ b/gfx/2d/DataSurfaceHelpers.cpp
@@ -234,19 +234,22 @@ void
 CopyRect(DataSourceSurface* aSrc, DataSourceSurface* aDest,
          IntRect aSrcRect, IntPoint aDestPoint)
 {
   if (aSrcRect.Overflows() ||
       IntRect(aDestPoint, aSrcRect.Size()).Overflows()) {
     MOZ_CRASH("we should never be getting invalid rects at this point");
   }
 
-  MOZ_ASSERT(aSrc->GetFormat() == aDest->GetFormat(), "different surface formats");
-  MOZ_ASSERT(IntRect(IntPoint(), aSrc->GetSize()).Contains(aSrcRect), "source rect too big for source surface");
-  MOZ_ASSERT(IntRect(IntPoint(), aDest->GetSize()).Contains(aSrcRect - aSrcRect.TopLeft() + aDestPoint), "dest surface too small");
+  MOZ_RELEASE_ASSERT(aSrc->GetFormat() == aDest->GetFormat(),
+                     "different surface formats");
+  MOZ_RELEASE_ASSERT(IntRect(IntPoint(), aSrc->GetSize()).Contains(aSrcRect),
+                     "source rect too big for source surface");
+  MOZ_RELEASE_ASSERT(IntRect(IntPoint(), aDest->GetSize()).Contains(IntRect(aDestPoint, aSrcRect.Size())),
+                     "dest surface too small");
 
   if (aSrcRect.IsEmpty()) {
     return;
   }
 
   uint8_t* sourceData = DataAtOffset(aSrc, aSrcRect.TopLeft());
   uint32_t sourceStride = aSrc->Stride();
   uint8_t* destData = DataAtOffset(aDest, aDestPoint);