From 092c4c88cd6cc941e4e826d8b7051e2c40bd4520 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Tue, 6 Jan 2015 12:08:39 +0100 Subject: [PATCH] Bug 1117304 - Also do the checks at the start of CopyRect in release builds. r=Bas --- gfx/2d/DataSurfaceHelpers.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gfx/2d/DataSurfaceHelpers.cpp b/gfx/2d/DataSurfaceHelpers.cpp index ab642fdefd84..d0f08fa295cd 100644 --- a/gfx/2d/DataSurfaceHelpers.cpp +++ b/gfx/2d/DataSurfaceHelpers.cpp @@ -239,9 +239,12 @@ CopyRect(DataSourceSurface* aSrc, DataSourceSurface* aDest, 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;