diff --git a/modules/libpr0n/src/imgContainer.cpp b/modules/libpr0n/src/imgContainer.cpp index 8fc25986647..d1d1e90d37f 100644 --- a/modules/libpr0n/src/imgContainer.cpp +++ b/modules/libpr0n/src/imgContainer.cpp @@ -1736,7 +1736,9 @@ void imgContainer::ClearFrame(imgFrame *aFrame) if (!aFrame) return; - aFrame->LockImageData(); + nsresult rv = aFrame->LockImageData(); + if (NS_FAILED(rv)) + return; nsRefPtr surf; aFrame->GetSurface(getter_AddRefs(surf)); @@ -1755,7 +1757,9 @@ void imgContainer::ClearFrame(imgFrame *aFrame, nsIntRect &aRect) if (!aFrame || aRect.width <= 0 || aRect.height <= 0) return; - aFrame->LockImageData(); + nsresult rv = aFrame->LockImageData(); + if (NS_FAILED(rv)) + return; nsRefPtr surf; aFrame->GetSurface(getter_AddRefs(surf)); diff --git a/modules/libpr0n/src/imgFrame.cpp b/modules/libpr0n/src/imgFrame.cpp index 4b140961f20..229a42b5a77 100644 --- a/modules/libpr0n/src/imgFrame.cpp +++ b/modules/libpr0n/src/imgFrame.cpp @@ -811,7 +811,7 @@ void imgFrame::GetPaletteData(PRUint32 **aPalette, PRUint32 *length) const nsresult imgFrame::LockImageData() { if (mPalettedImageData) - return NS_OK; + return NS_ERROR_NOT_AVAILABLE; if ((mOptSurface || mSinglePixel) && !mImageSurface) { // Recover the pixels @@ -843,7 +843,7 @@ nsresult imgFrame::LockImageData() nsresult imgFrame::UnlockImageData() { if (mPalettedImageData) - return NS_OK; + return NS_ERROR_NOT_AVAILABLE; #ifdef XP_MACOSX if (mQuartzSurface)