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