Bug 591014: Null-check mImage in imgRequestProxy::GetStaticRequest. r=joe a=blocking-beta5

This commit is contained in:
Daniel Holbert 2010-08-26 20:47:20 +00:00
Родитель 3f8fe94997
Коммит 3a679de655
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -727,7 +727,7 @@ imgRequestProxy::GetStaticRequest(imgIRequest** aReturn)
*aReturn = nsnull;
PRBool animated;
if (NS_SUCCEEDED(mImage->GetAnimated(&animated)) && !animated) {
if (!mImage || (NS_SUCCEEDED(mImage->GetAnimated(&animated)) && !animated)) {
// Early exit - we're not animated, so we don't have to do anything.
NS_ADDREF(*aReturn = this);
return NS_OK;
@ -795,7 +795,7 @@ void imgRequestProxy::SyncNotifyListener()
void
imgRequestProxy::SetImage(Image* aImage)
{
NS_ABORT_IF_FALSE(!mImage, "Setting null image");
NS_ABORT_IF_FALSE(aImage, "Setting null image");
NS_ABORT_IF_FALSE(!mImage, "Setting image when we already have one");
mImage = aImage;