From d1bcb5139c1099aa39f5d6f3b9ba85d56af507d0 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Mon, 30 Apr 2012 15:11:47 +1200 Subject: [PATCH] Bug 664918. Part 6: ImageContainer::GetCurrentAsSurface shouldn't crash when mActiveImage is null. r=bas --- gfx/layers/ImageLayers.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gfx/layers/ImageLayers.cpp b/gfx/layers/ImageLayers.cpp index b561ef69c81b..19b93722a23f 100644 --- a/gfx/layers/ImageLayers.cpp +++ b/gfx/layers/ImageLayers.cpp @@ -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