From c23a17de07675a38cf0c26c8c755bf1d67d4e72a Mon Sep 17 00:00:00 2001 From: John Daggett Date: Wed, 11 Sep 2013 10:36:58 +0900 Subject: [PATCH] Bug 522515 - omit null urls from inclusion in userfont src descriptor array. r=dbaron --- layout/style/nsFontFaceLoader.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/layout/style/nsFontFaceLoader.cpp b/layout/style/nsFontFaceLoader.cpp index ae6a3a5aebac..8829ab100bbb 100644 --- a/layout/style/nsFontFaceLoader.cpp +++ b/layout/style/nsFontFaceLoader.cpp @@ -622,7 +622,12 @@ nsUserFontSet::InsertRule(nsCSSFontFaceRule *aRule, uint8_t aSheetType, case eCSSUnit_URL: face->mIsLocal = false; face->mURI = val.GetURLValue(); - NS_ASSERTION(face->mURI, "null url in @font-face rule"); + if (!face->mURI) { + // if URI not valid, omit from src array + srcArray.RemoveElementAt(srcArray.Length() - 1); + NS_WARNING("null url in @font-face rule"); + continue; + } face->mReferrer = val.GetURLStructValue()->mReferrer; face->mOriginPrincipal = val.GetURLStructValue()->mOriginPrincipal; NS_ASSERTION(face->mOriginPrincipal, "null origin principal in @font-face rule");