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 243047 4417d345698a
parent 243046 6601b8da1750
child 243048 bc7489448a98
push id4373
push userryanvm@gmail.com
push date2015-01-26 18:43 +0000
treeherdermozilla-beta@bc7489448a98 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBas, sledru
bugs1117304
milestone36.0
Bug 1117304 - Also do the checks at the start of CopyRect in release builds. r=Bas, a=sledru
gfx/2d/FilterNodeSoftware.cpp
--- a/gfx/2d/FilterNodeSoftware.cpp
+++ b/gfx/2d/FilterNodeSoftware.cpp
@@ -227,19 +227,22 @@ static void
 CopyRect(DataSourceSurface* aSrc, DataSourceSurface* aDest,
          IntRect aSrcRect, IntPoint aDestPoint)
 {
   if (IntRectOverflows(aSrcRect) ||
       IntRectOverflows(IntRect(aDestPoint, aSrcRect.Size()))) {
     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);