Bug 526452 - imgContainer::ClearFrame() should handle failure to lockImage/null surfaces. r=jrmuizel

--HG--
extra : rebase_source : 013117f751f87ab9bbe087793d044bba1b6f02da
This commit is contained in:
Makoto Kato 2009-11-18 18:20:24 -05:00
parent 91cb55177b
commit 30d873946f
2 changed files with 8 additions and 4 deletions

View File

@ -1736,7 +1736,9 @@ void imgContainer::ClearFrame(imgFrame *aFrame)
if (!aFrame)
return;
aFrame->LockImageData();
nsresult rv = aFrame->LockImageData();
if (NS_FAILED(rv))
return;
nsRefPtr<gfxASurface> 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<gfxASurface> surf;
aFrame->GetSurface(getter_AddRefs(surf));

View File

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