File fix_infinite_loop_bwo97258.diff of Package libQtWebKit4.openSUSE_12.3_Update

diff -U 3 -H -d -r -N -x '.svn/*' -- QtWebKit-2.2.0/LayoutTests/ChangeLog QtWebKit-2.2.0.bwo97258/LayoutTests/ChangeLog
--- QtWebKit-2.2.0/LayoutTests/ChangeLog	2011-09-13 22:23:44.000000000 +0200
+++ QtWebKit-2.2.0.bwo97258/LayoutTests/ChangeLog	2012-12-19 16:55:50.320166004 +0100
@@ -1,3 +1,13 @@
+2012-10-17  Allan Sandfeld Jensen  <allan.jensen@digia.com>
+
+        [Qt] Certain SVG content freezes QtWebKit
+        https://bugs.webkit.org/show_bug.cgi?id=97258
+
+        Reviewed by Simon Hausmann.
+
+        * svg/stroke/zero-width-hang-expected.txt: Added.
+        * svg/stroke/zero-width-hang.html: Added.
+
 2011-09-08  Jarred Nicholls  <jarred@sencha.com>
 
         frame-loading-via-document-write.html test cases have extra slash in path
diff -U 3 -H -d -r -N -x '.svn/*' -- QtWebKit-2.2.0/LayoutTests/svg/stroke/zero-width-hang-expected.txt QtWebKit-2.2.0.bwo97258/LayoutTests/svg/stroke/zero-width-hang-expected.txt
--- QtWebKit-2.2.0/LayoutTests/svg/stroke/zero-width-hang-expected.txt	1970-01-01 01:00:00.000000000 +0100
+++ QtWebKit-2.2.0.bwo97258/LayoutTests/svg/stroke/zero-width-hang-expected.txt	2012-12-19 16:55:50.309232198 +0100
@@ -0,0 +1 @@
+This test PASS if it doesn't cause the page to freeze. 
diff -U 3 -H -d -r -N -x '.svn/*' -- QtWebKit-2.2.0/LayoutTests/svg/stroke/zero-width-hang.html QtWebKit-2.2.0.bwo97258/LayoutTests/svg/stroke/zero-width-hang.html
--- QtWebKit-2.2.0/LayoutTests/svg/stroke/zero-width-hang.html	1970-01-01 01:00:00.000000000 +0100
+++ QtWebKit-2.2.0.bwo97258/LayoutTests/svg/stroke/zero-width-hang.html	2012-12-19 16:55:50.310237712 +0100
@@ -0,0 +1,16 @@
+<html>
+  <head>
+  <title> SVG lock up test</title>
+  </head>
+  <body>
+    This test PASS if it doesn't cause the page to freeze.
+    <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="312" height="200">
+    <path style="stroke-width: 0px; stroke-linejoin: miter; " fill="none" stroke="#ffffff" d="M0,1L312,1" stroke-linejoin="miter" stroke-dasharray="0,0"></path>
+    </svg>
+    <script>
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+        }
+    </script>
+  </body>
+</html>
diff -U 3 -H -d -r -N -x '.svn/*' -- QtWebKit-2.2.0/Source/WebCore/ChangeLog QtWebKit-2.2.0.bwo97258/Source/WebCore/ChangeLog
--- QtWebKit-2.2.0/Source/WebCore/ChangeLog	2011-09-13 22:23:44.000000000 +0200
+++ QtWebKit-2.2.0.bwo97258/Source/WebCore/ChangeLog	2012-12-19 16:55:50.336194829 +0100
@@ -1,3 +1,17 @@
+2012-10-17  Allan Sandfeld Jensen  <allan.jensen@digia.com>
+
+        [Qt] Certain SVG content freezes QtWebKit
+        https://bugs.webkit.org/show_bug.cgi?id=97258
+
+        Reviewed by Simon Hausmann.
+
+        Ensure dashpattern is well-formed by avoiding divisions by zero.
+
+        Test: svg/stroke/zero-width-hang.html
+
+        * platform/graphics/qt/GraphicsContextQt.cpp:
+        (WebCore::GraphicsContext::setLineDash):
+
 2011-09-12  Adam Klein  <adamk@chromium.org>
 
         Fix out-of-bounds access in Gradient::sortStopsIfNecessary
diff -U 3 -H -d -r -N -x '.svn/*' -- QtWebKit-2.2.0/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp QtWebKit-2.2.0.bwo97258/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
--- QtWebKit-2.2.0/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp	2011-09-13 22:23:44.000000000 +0200
+++ QtWebKit-2.2.0.bwo97258/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp	2012-12-19 16:55:50.337132115 +0100
@@ -1057,6 +1057,9 @@
             count *= 2;
 
         float penWidth = narrowPrecisionToFloat(double(pen.widthF()));
+        if (penWidth <= 0.f)
+            penWidth = 1.f;
+
         for (unsigned i = 0; i < count; i++)
             pattern.append(dashes[i % dashLength] / penWidth);
 
openSUSE Build Service is sponsored by