[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

hausmann at webkit.org hausmann at webkit.org
Wed Apr 7 23:46:11 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 32f428da65b5022adb528d781f814efedb09a5ec
Author: hausmann at webkit.org <hausmann at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 18 10:29:05 2009 +0000

    [Qt] WebKit crashes when loading certain SVG images
    
    Patch by Benjamin Poulain <benjamin.poulain at nokia.com> on 2009-11-18
    Reviewed by Simon Hausmann.
    
    WebCore:
    
    Check if the familly exist before creating the PlatformData from it.
    
    https://bugs.webkit.org/show_bug.cgi?id=29443
    
    Test: svg/text/text-font-invalid.html
    
    * platform/graphics/qt/FontFallbackListQt.cpp:
    (WebCore::FontFallbackList::fontDataAt):
    
    LayoutTests:
    
    Added a test for a crash of QtWebkit when loading SVG images.
    
    https://bugs.webkit.org/show_bug.cgi?id=29443
    
    * svg/text/resources/text-font-invalid.svg: Added.
    * svg/text/text-font-invalid-expected.txt: Added.
    * svg/text/text-font-invalid.html: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51103 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 2a1160c..49994dc 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2009-11-18  Benjamin Poulain  <benjamin.poulain at nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] WebKit crashes when loading certain SVG images
+
+        Added a test for a crash of QtWebkit when loading SVG images.
+
+        https://bugs.webkit.org/show_bug.cgi?id=29443
+
+        * svg/text/resources/text-font-invalid.svg: Added.
+        * svg/text/text-font-invalid-expected.txt: Added.
+        * svg/text/text-font-invalid.html: Added.
+
 2009-11-17  Hayato Ito  <hayato at google.com>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/svg/text/resources/text-font-invalid.svg b/LayoutTests/svg/text/resources/text-font-invalid.svg
new file mode 100644
index 0000000..0f9e006
--- /dev/null
+++ b/LayoutTests/svg/text/resources/text-font-invalid.svg
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1">
+  <defs>
+    <font-face font-family="Arbitrary font not on the system">
+    <font-face-src>
+      <font-face-name name="VeryUnlikelyToExistFont"/>
+    </font-face-src>
+    </font-face>
+  </defs>
+  <g>
+    <text>
+      <tspan font-family="Arbitrary font not on the system">Foobar</tspan>
+    </text>
+  </g>
+</svg>
+
diff --git a/LayoutTests/svg/text/text-font-invalid-expected.txt b/LayoutTests/svg/text/text-font-invalid-expected.txt
new file mode 100644
index 0000000..8c848d6
--- /dev/null
+++ b/LayoutTests/svg/text/text-font-invalid-expected.txt
@@ -0,0 +1,3 @@
+This test is to ensure that we do not crash when loading a SVG image without a valid font-family
+PASS: Did not crash when rendering the SVG image.
+
diff --git a/LayoutTests/svg/text/text-font-invalid.html b/LayoutTests/svg/text/text-font-invalid.html
new file mode 100644
index 0000000..7c9a16f
--- /dev/null
+++ b/LayoutTests/svg/text/text-font-invalid.html
@@ -0,0 +1,12 @@
+<html>
+  <body>
+    This test is to ensure that we do not crash when loading a SVG image without a valid font-family
+    <div id="log"><span style='color: red;'>FAIL:</span> Did not complete test</div>
+    <img src="resources/text-font-invalid.svg" />
+    <script>
+        if (window.layoutTestController)
+            layoutTestController.dumpAsText();
+        document.getElementById("log").innerHTML = "<span style='color: green;'>PASS:</span> Did not crash when rendering the SVG image.";
+    </script>
+  </body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index c1f5ecb..58440e9 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2009-11-18  Benjamin Poulain  <benjamin.poulain at nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] WebKit crashes when loading certain SVG images
+
+        Check if the familly exist before creating the PlatformData from it.
+
+        https://bugs.webkit.org/show_bug.cgi?id=29443
+
+        Test: svg/text/text-font-invalid.html
+
+        * platform/graphics/qt/FontFallbackListQt.cpp:
+        (WebCore::FontFallbackList::fontDataAt):
+
 2009-11-17  Nicolas Weber  <thakis at chromium.org>
 
         Reviewed by Darin Fisher.
diff --git a/WebCore/platform/graphics/qt/FontFallbackListQt.cpp b/WebCore/platform/graphics/qt/FontFallbackListQt.cpp
index 8e1e4f6..0306abf 100644
--- a/WebCore/platform/graphics/qt/FontFallbackListQt.cpp
+++ b/WebCore/platform/graphics/qt/FontFallbackListQt.cpp
@@ -102,7 +102,7 @@ const FontData* FontFallbackList::fontDataAt(const WebCore::Font* _font, unsigne
     const FontDescription& description = _font->fontDescription();
     const FontFamily* family = &description.family();
     while (family) {
-        if (m_fontSelector) {
+        if (family->family().length() && m_fontSelector) {
             FontData* data = m_fontSelector->getFontData(description, family->family());
             if (data) {
                 if (data->isLoading())

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list