Bug 1130607 - Cancel our imgRequest if we get an unexpected duplicate imgRequest event. r=tn

This commit is contained in:
Seth Fowler 2015-03-03 18:19:21 -08:00
parent fde5bd3e33
commit 28ba21ba07

View File

@ -647,9 +647,12 @@ NS_IMETHODIMP imgRequest::OnStartRequest(nsIRequest *aRequest, nsISupports *ctxt
MOZ_ASSERT(!mIsMultiPartChannel, "Something went wrong"); MOZ_ASSERT(!mIsMultiPartChannel, "Something went wrong");
} }
// If we're not multipart, we shouldn't have an image yet // If we're not multipart, we shouldn't have an image yet.
MOZ_ASSERT(mIsMultiPartChannel || !mImage, if (mImage && !mIsMultiPartChannel) {
"Already have an image for non-multipart request"); MOZ_ASSERT_UNREACHABLE("Already have an image for a non-multipart request");
Cancel(NS_IMAGELIB_ERROR_FAILURE);
return NS_ERROR_FAILURE;
}
/* /*
* If mRequest is null here, then we need to set it so that we'll be able to * If mRequest is null here, then we need to set it so that we'll be able to