Reviewed by Oliver Hunt.
[WebKit-https.git] / WebCore / css / CSSSegmentedFontFace.cpp
index 2705bffbca84f467a7656427531582160dd27bf6..05c0c799e683566b3b30b591ab7e2b865a0c334c 100644 (file)
@@ -127,7 +127,12 @@ FontData* CSSSegmentedFontFace::getFontData(const FontDescription& fontDescripti
             fontData->appendRange(FontDataRange(m_ranges[i].from(), m_ranges[i].to(), static_cast<const SimpleFontData*>(rangeFontData)));
         }
     }
-    m_fontDataTable.set(hashKey, fontData);
+    if (fontData->numRanges())
+        m_fontDataTable.set(hashKey, fontData);
+    else {
+        delete fontData;
+        fontData = 0;
+    }
 
     return fontData;
 }