bug 822865 - Null check the background outparam before assigning to it. r=roc
authorMatt Woodrow <mwoodrow@mozilla.com>
Fri, 21 Dec 2012 22:09:25 +1300
changeset 116702 3b4cfcc2aed22b4bc09c2592eaf81ea071f7c6d7
parent 116701 9e594f7b7a12e63e6632bbc71bb522f9dcdf5b2b
child 116703 60d6ae8c01efe1b4b34e2bde2785ceb859e78940
push id20101
push usermwoodrow@mozilla.com
push dateFri, 21 Dec 2012 09:09:37 +0000
treeherdermozilla-inbound@3b4cfcc2aed2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs822865
milestone20.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 822865 - Null check the background outparam before assigning to it. r=roc
layout/base/nsDisplayList.cpp
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -1596,17 +1596,19 @@ nsDisplayBackgroundImage::AppendBackgrou
 
   if (isThemed) {
     nsDisplayBackgroundImage* bgItem =
       new (aBuilder) nsDisplayBackgroundImage(aBuilder, aFrame, 0, isThemed, nullptr);
     nsresult rv = aList->AppendNewToTop(bgItem);
     if (rv != NS_OK) {
       return rv;
     }
-    *aBackground = bgItem;
+    if (aBackground) {
+      *aBackground = bgItem;
+    }
     return NS_OK;
   }
 
   if (!bg) {
     return NS_OK;
   }
  
   // Passing bg == nullptr in this macro will result in one iteration with