Bug 595154 - Part 4: Bail when texture lock fails. r=vlad a=b

This commit is contained in:
Bas Schouten 2010-09-14 12:57:25 +02:00
Родитель b00f4315b9
Коммит 690c044661
1 изменённых файлов: 12 добавлений и 2 удалений

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

@ -109,7 +109,12 @@ CanvasLayerD3D9::Updated(const nsIntRect& aRect)
if (mGLContext) {
// WebGL reads entire surface.
D3DLOCKED_RECT r;
mTexture->LockRect(0, &r, NULL, 0);
HRESULT hr = mTexture->LockRect(0, &r, NULL, 0);
if (FAILED(hr)) {
NS_WARNING("Failed to lock CanvasLayer texture.");
return;
}
PRUint8 *destination;
if (r.Pitch != mBounds.width * 4) {
@ -165,7 +170,12 @@ CanvasLayerD3D9::Updated(const nsIntRect& aRect)
r.bottom = aRect.YMost();
D3DLOCKED_RECT lockedRect;
mTexture->LockRect(0, &lockedRect, &r, 0);
HRESULT hr = mTexture->LockRect(0, &lockedRect, &r, 0);
if (FAILED(hr)) {
NS_WARNING("Failed to lock CanvasLayer texture.");
return;
}
PRUint8 *startBits;
PRUint32 sourceStride;