From 056378aa50e54c9c52e05dd9a14300ec2ab66b70 Mon Sep 17 00:00:00 2001 From: Ethan Lin Date: Wed, 1 Nov 2017 14:54:17 +0800 Subject: [PATCH] Bug 1413082 - Check both STATUS_LOAD_COMPLETE and STATUS_ERROR before getting the image container in nsImageFrame. r=mattwoodrow MozReview-Commit-ID: H5pTpJVG33p --HG-- extra : rebase_source : dca566b51d5e4f4cb4a18e612c1ed13cefb18f9b --- layout/generic/nsImageFrame.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index 6fa32f97cbbd..b91819aa1a87 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -1443,7 +1443,8 @@ nsImageFrame::DisplayAltFeedback(gfxContext& aRenderingContext, uint32_t imageStatus = 0; if (request) request->GetImageStatus(&imageStatus); - if (imageStatus & imgIRequest::STATUS_LOAD_COMPLETE) { + if (imageStatus & imgIRequest::STATUS_LOAD_COMPLETE && + !(imageStatus & imgIRequest::STATUS_ERROR)) { nsCOMPtr imgCon; request->GetImage(getter_AddRefs(imgCon)); MOZ_ASSERT(imgCon, "Load complete, but no image container?");