bug 1281971 - Fix null pointer access in TryToStartImageLoadOnValue.
MozReview-Commit-ID: 6FAXlMb8iQr
--- a/layout/style/nsCSSDataBlock.cpp
+++ b/layout/style/nsCSSDataBlock.cpp
@@ -66,20 +66,22 @@ TryToStartImageLoadOnValue(const nsCSSVa
// For example,
// mask-image: url(#mask_id); // refer to a SVG mask element, whose id is
// // "mask_id", in the current document.
// For such 'mask-image' values (pointing to an in-document element),
// there is no need to trigger image download.
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
aValue.StartImageLoad(aDocument);
if (aForTokenStream && aContext) {
CSSVariableImageTable::Add(aContext, aProperty,
aValue.GetImageStructValue());
}