Bug 1117304 - Also do the checks at the start of CopyRect in release builds. r=Bas

This commit is contained in:
Markus Stange 2015-01-06 12:08:39 +01:00
parent 6ad9ccfee6
commit 092c4c88cd

View File

@ -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;