Bug 1413082 - Check both STATUS_LOAD_COMPLETE and STATUS_ERROR before getting the image container in nsImageFrame. r=mattwoodrow
authorEthan Lin <ethlin@mozilla.com>
Wed, 01 Nov 2017 14:54:17 +0800
changeset 390308 a94bd2a1b543403beb8c94f7cb0d166cc4a21583
parent 390307 f43442328ed98b47cdc1eddd14c064c9f6344ea5
child 390309 c9e777a6f988280c8a4c13ec1472167cfb2f85d1
push id32827
push userccoroiu@mozilla.com
push dateMon, 06 Nov 2017 23:02:00 +0000
treeherdermozilla-central@62aeebcc676e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1413082
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1413082 - Check both STATUS_LOAD_COMPLETE and STATUS_ERROR before getting the image container in nsImageFrame. r=mattwoodrow MozReview-Commit-ID: H5pTpJVG33p
layout/generic/nsImageFrame.cpp
--- a/layout/generic/nsImageFrame.cpp
+++ b/layout/generic/nsImageFrame.cpp
@@ -1438,17 +1438,18 @@ nsImageFrame::DisplayAltFeedback(gfxCont
     WritingMode wm = GetWritingMode();
     bool flushRight =
       (!wm.IsVertical() && !wm.IsBidiLTR()) || wm.IsVerticalRL();
 
     // If the icon in question is loaded, draw it.
     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<imgIContainer> imgCon;
       request->GetImage(getter_AddRefs(imgCon));
       MOZ_ASSERT(imgCon, "Load complete, but no image container?");
       nsRect dest(flushRight ? inner.XMost() - size : inner.x,
                   inner.y, size, size);
       result = nsLayoutUtils::DrawSingleImage(aRenderingContext, PresContext(), imgCon,
         nsLayoutUtils::GetSamplingFilterForFrame(this), dest, aDirtyRect,
         /* no SVGImageContext */ Nothing(), aFlags);