Bug 664918. Part 6: ImageContainer::GetCurrentAsSurface shouldn't crash when mActiveImage is null. r=bas

This commit is contained in:
Robert O'Callahan 2012-04-30 15:11:47 +12:00
parent 587d304a70
commit d1bcb5139c

View File

@ -231,12 +231,15 @@ ImageContainer::GetCurrentAsSurface(gfxIntSize *aSize)
CrossProcessMutexAutoLock autoLock(*mRemoteDataMutex);
EnsureActiveImage();
if (!mActiveImage)
return nsnull;
*aSize = mRemoteData->mSize;
return mActiveImage ? mActiveImage->GetAsSurface() : nsnull;
} else {
if (!mActiveImage)
return nsnull;
*aSize = mActiveImage->GetSize();
}
*aSize = mActiveImage->GetSize();
return mActiveImage ? mActiveImage->GetAsSurface() : nsnull;
return mActiveImage->GetAsSurface();
}
gfxIntSize