mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 526452 - imgContainer::ClearFrame() should handle failure to lockImage/null surfaces. r=jrmuizel
--HG-- extra : rebase_source : 013117f751f87ab9bbe087793d044bba1b6f02da
This commit is contained in:
parent
91cb55177b
commit
30d873946f
@ -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));
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user