Reviewed by Maciej.
authorrwlbuis <rwlbuis@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Sep 2006 09:25:48 +0000 (09:25 +0000)
committerrwlbuis <rwlbuis@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Sep 2006 09:25:48 +0000 (09:25 +0000)
        http://bugzilla.opendarwin.org/show_bug.cgi?id=10807
        REGRESSION (r16259): Repro crash on manual-tests/svg-repaint-image.svg

        Make sure the paint method is not exited without popping
        context and transparency layer.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16421 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/kcanvas/RenderSVGImage.cpp

index 2c99975e207b98b018620b910abfb2aae664dc4d..8667ae1ca1cd9af5b4dc6dd4da455195d93d12cb 100644 (file)
@@ -1,3 +1,18 @@
+2006-09-18  Rob Buis  <buis@kde.org>
+
+        Reviewed by Maciej.
+
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=10807
+        REGRESSION (r16259): Repro crash on manual-tests/svg-repaint-image.svg
+
+        Make sure the paint method is not exited without popping
+        context and transparency layer.
+
+        WARNING: NO TEST CASES ADDED OR CHANGED
+
+        * kcanvas/RenderSVGImage.cpp:
+        (WebCore::RenderSVGImage::paint):
+
 2006-09-18  Graham Dennis  <graham.dennis@gmail.com>
 
         Reviewed by Eric.
index a9c4c72bca5178dcac6f0d33aa3568531ddd712c..2387b2c304a942c219d32e640b531f1e5e2c7627 100644 (file)
@@ -166,22 +166,21 @@ void RenderSVGImage::paint(PaintInfo& paintInfo, int parentX, int parentY)
     pi.r = absoluteTransform().invert().mapRect(paintInfo.r);
 
     int x = 0, y = 0;
-    if (!shouldPaint(pi, x, y))
-        return;
-        
-    SVGImageElement *imageElt = static_cast<SVGImageElement *>(node());
+    if (shouldPaint(pi, x, y)) {
+        SVGImageElement *imageElt = static_cast<SVGImageElement *>(node());
         
-    if (imageElt->preserveAspectRatio()->align() == SVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_NONE)
-        RenderImage::paint(pi, 0, 0);
-    else {
-        FloatRect destRect(m_x, m_y, contentWidth(), contentHeight());
-        FloatRect srcRect(0, 0, image()->width(), image()->height());
-        adjustRectsForAspectRatio(destRect, srcRect, imageElt->preserveAspectRatio());
-        c->drawImage(image(), destRect, srcRect);
-    }
+        if (imageElt->preserveAspectRatio()->align() == SVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_NONE)
+            RenderImage::paint(pi, 0, 0);
+        else {
+            FloatRect destRect(m_x, m_y, contentWidth(), contentHeight());
+            FloatRect srcRect(0, 0, image()->width(), image()->height());
+            adjustRectsForAspectRatio(destRect, srcRect, imageElt->preserveAspectRatio());
+            c->drawImage(image(), destRect, srcRect);
+        }
 
-    if (filter)
-        filter->applyFilter(boundingBox);
+        if (filter)
+            filter->applyFilter(boundingBox);
+    }
     
     if (opacity < 1.0f)
         c->endTransparencyLayer();