<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>37751</bug_id>
          
          <creation_ts>2010-04-17 02:32:48 -0700</creation_ts>
          <short_desc>Infinite recursion in WebCore::SVGPatternElement::buildPattern leads to stack exhaustion</short_desc>
          <delta_ts>2010-04-19 03:26:23 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>SVG</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>32171</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Tobias Klein">tk.chromium</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>krit</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>213594</commentid>
    <comment_count>0</comment_count>
    <who name="Tobias Klein">tk.chromium</who>
    <bug_when>2010-04-17 02:32:48 -0700</bug_when>
    <thetext>Opening the attached SVG file causes infinite recursion in WebCore::SVGPatternElement::buildPattern, which leads to stack exhaustion.

Code snippet:

http://svn.webkit.org/repository/webkit/trunk/WebCore/svg/SVGPatternElement.cpp

[..]
void SVGPatternElement::buildPattern(const FloatRect&amp; targetRect) const
{
[..]
    // Render subtree into ImageBuffer
    for (Node* n = attributes.patternContentElement()-&gt;firstChild(); n; n = n-&gt;nextSibling()) {
        if (!n-&gt;isSVGElement() || !static_cast&lt;SVGElement*&gt;(n)-&gt;isStyled() || !n-&gt;renderer())
            continue;
        renderSubtreeToImage(patternImage.get(), n-&gt;renderer());
    }
[..]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>213595</commentid>
    <comment_count>1</comment_count>
      <attachid>53595</attachid>
    <who name="Tobias Klein">tk.chromium</who>
    <bug_when>2010-04-17 02:33:59 -0700</bug_when>
    <thetext>Created attachment 53595
Testcase</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>213981</commentid>
    <comment_count>2</comment_count>
    <who name="Dirk Schulze">krit</who>
    <bug_when>2010-04-19 03:26:23 -0700</bug_when>
    <thetext>Thanks for the test case.

*** This bug has been marked as a duplicate of bug 32171 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>53595</attachid>
            <date>2010-04-17 02:33:59 -0700</date>
            <delta_ts>2010-04-17 02:33:59 -0700</delta_ts>
            <desc>Testcase</desc>
            <filename>testcase.xhtml</filename>
            <type>application/xhtml+xml</type>
            <size>346</size>
            <attacher name="Tobias Klein">tk.chromium</attacher>
            
              <data encoding="base64">PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1s
bnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPg0KIDxkZWZzPg0KICA8cGF0
dGVybiBpZD0idGVzdCIgeD0iMTAiIHk9IjEwIiB3aWR0aD0iMTAiIGhlaWdodD0iMTAiPg0KICAg
PGVsbGlwc2UgY3g9IjEwIiBjeT0iMTAiIHJ4PSIxMCIgcnk9IjEwIiBmaWxsPSJ1cmwoI3Rlc3Qp
IiAvPg0KICA8L3BhdHRlcm4+DQogPC9kZWZzPg0KIDxyZWN0IHg9IjEwIiB5PSIxMCIgd2lkdGg9
IjEwIiBoZWlnaHQ9IjEwIiByeD0iMTAiIHJ5PSIxMCIgZmlsbD0idXJsKCN0ZXN0KSIgLz4NCjwv
c3ZnPg==
</data>

          </attachment>
      

    </bug>

</bugzilla>