Bug 1496839 - Avoid dereferencing null frame r=mattwoodrow
authorMiko Mynttinen <mikokm@gmail.com>
Thu, 18 Oct 2018 02:26:59 +0000
changeset 500380 8a1bcc91affb90fbdb0f36d5c45d0629e4b43622
parent 500379 3a18b352f6fb76d157dd54ea1cb8e1ba6c35d97f
child 500381 c645265aa5b827fac52c3692991cbd55558d5821
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1496839
milestone64.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 1496839 - Avoid dereferencing null frame r=mattwoodrow Differential Revision: https://phabricator.services.mozilla.com/D8882
layout/ipc/RenderFrameParent.cpp
--- a/layout/ipc/RenderFrameParent.cpp
+++ b/layout/ipc/RenderFrameParent.cpp
@@ -434,10 +434,12 @@ nsDisplayRemote::GetRemoteLayersId() con
 {
   MOZ_ASSERT(GetRenderFrameParent());
   return GetRenderFrameParent()->GetLayersId();
 }
 
 mozilla::layout::RenderFrameParent*
 nsDisplayRemote::GetRenderFrameParent() const
 {
-  return static_cast<nsSubDocumentFrame*>(Frame())->GetRenderFrameParent();
+  return mFrame
+    ? static_cast<nsSubDocumentFrame*>(mFrame)->GetRenderFrameParent()
+    : nullptr;
 }