Bug 519532 - Null deference in nsMenuItemIconX::OnStopFrame(). r=josh

This commit is contained in:
Steven Michaud 2009-09-30 14:36:28 -05:00
parent 08bed1367a
commit 2019c10ca2

View File

@ -348,9 +348,11 @@ nsMenuItemIconX::OnStopFrame(imgIRequest* aRequest,
return NS_ERROR_FAILURE;
nsRefPtr<gfxImageSurface> image;
imageContainer->CopyFrame(imgIContainer::FRAME_CURRENT,
imgIContainer::FLAG_NONE,
getter_AddRefs(image));
nsresult rv = imageContainer->CopyFrame(imgIContainer::FRAME_CURRENT,
imgIContainer::FLAG_NONE,
getter_AddRefs(image));
if (NS_FAILED(rv) || !image)
return NS_ERROR_FAILURE;
PRInt32 height = image->Height();
PRInt32 stride = image->Stride();