Bug 1061696 - Don't crash release builds when failing to allocate a surface in AutoRestoreClippedOut::save. r=Bas

This commit is contained in:
Nicolas Silva 2014-09-11 17:27:48 +02:00
Родитель d41b38b4b3
Коммит 79f2cf5d6d
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -76,7 +76,10 @@ public:
HRESULT hr = mDT->mDevice->CreateTexture2D(&desc, nullptr, byRef(tmpTexture));
if (FAILED(hr)) {
gfxWarning() << "Failed to create temporary texture to hold surface data.";
gfxWarning() << "Failure to create temporary texture. Size: " << size << " Code: " << hr;
// Crash debug builds but try to recover in release builds.
MOZ_ASSERT(false);
return;
}
mDT->mDevice->CopyResource(tmpTexture, mDT->mTexture);
@ -90,7 +93,10 @@ public:
&props, byRef(mOldSurfBitmap));
if (FAILED(hr)) {
gfxWarning() << "Failed to create shared bitmap for old surface.";
gfxWarning() << "Failed to create shared bitmap for old surface. Code: " << hr;
// Crash debug builds but try to recover in release builds.
MOZ_ASSERT(false);
return;
}
IntRect clipBounds;