From 0ae824a629efb18bdf7f5dd8db56fb61b9c396fa Mon Sep 17 00:00:00 2001 From: cku Date: Sat, 25 Jun 2016 00:52:20 +0800 Subject: [PATCH] bug 1281971 - Fix null pointer access in TryToStartImageLoadOnValue. r=dholbert MozReview-Commit-ID: 6FAXlMb8iQr --HG-- extra : rebase_source : 92e09dbb637403dd93da7ee16243da80976cff6c --- layout/style/nsCSSDataBlock.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/layout/style/nsCSSDataBlock.cpp b/layout/style/nsCSSDataBlock.cpp index b8a0f9360f4c..7ee026deb52b 100644 --- a/layout/style/nsCSSDataBlock.cpp +++ b/layout/style/nsCSSDataBlock.cpp @@ -71,10 +71,12 @@ TryToStartImageLoadOnValue(const nsCSSValue& aValue, nsIDocument* aDocument, if (aProperty == eCSSProperty_mask_image) { nsIURI* docURI = aDocument->GetDocumentURI(); nsIURI* imageURI = aValue.GetURLValue(); - bool isEqualExceptRef = false; - nsresult rv = imageURI->EqualsExceptRef(docURI, &isEqualExceptRef); - if (NS_SUCCEEDED(rv) && isEqualExceptRef) { - return; + if (imageURI) { + bool isEqualExceptRef = false; + nsresult rv = imageURI->EqualsExceptRef(docURI, &isEqualExceptRef); + if (NS_SUCCEEDED(rv) && isEqualExceptRef) { + return; + } } } #endif