Bug 1429215: Null-check pointer before using it in assertion in GetFloatFromPlaceholder() (to avoid crashing during assertion). r=mats
authorDaniel Holbert <dholbert@cs.stanford.edu>
Tue, 09 Jan 2018 12:54:21 -0800
changeset 452757 bef5e30e6243e476d8f6a410be7cf2a583352447
parent 452756 bc3097b1f20a77c0f4fdcfb86597b2a4dd9f4670
child 452758 ccb64910979ad80245221ad8baa2e6dd4b7a5b20
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs1429215
milestone59.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 1429215: Null-check pointer before using it in assertion in GetFloatFromPlaceholder() (to avoid crashing during assertion). r=mats MozReview-Commit-ID: 7pWq8nr1mqQ
layout/base/nsLayoutUtils.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -1703,17 +1703,17 @@ nsLayoutUtils::GetRealPrimaryFrameFor(co
 }
 
 nsIFrame*
 nsLayoutUtils::GetFloatFromPlaceholder(nsIFrame* aFrame) {
   NS_ASSERTION(aFrame->IsPlaceholderFrame(), "Must have a placeholder here");
   if (aFrame->GetStateBits() & PLACEHOLDER_FOR_FLOAT) {
     nsIFrame *outOfFlowFrame =
       nsPlaceholderFrame::GetRealFrameForPlaceholder(aFrame);
-    NS_ASSERTION(outOfFlowFrame->IsFloating(),
+    NS_ASSERTION(outOfFlowFrame && outOfFlowFrame->IsFloating(),
                  "How did that happen?");
     return outOfFlowFrame;
   }
 
   return nullptr;
 }
 
 // static