<?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>38684</bug_id>
          
          <creation_ts>2010-05-06 13:32:05 -0700</creation_ts>
          <short_desc>Incorrect RenderPath object size when large coordinate values encountered</short_desc>
          <delta_ts>2016-10-12 05:43:45 -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>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>25645</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="W. James MacLean">wjmaclean</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>krit</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>221925</commentid>
    <comment_count>0</comment_count>
    <who name="W. James MacLean">wjmaclean</who>
    <bug_when>2010-05-06 13:32:05 -0700</bug_when>
    <thetext>Steps to Reproduce:

Render the attached SVG file (mask-excessive-malloc.svg, from the existing layout tests directory)

Actual output: dumping the render tree gives

layer at (0,0) size 800x600
  RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
  RenderSVGRoot {svg} at (0,0) size 800x600
    RenderSVGResourceMasker {mask} [id=&quot;mask&quot;] [maskUnits=objectBoundingBox] [maskContentUnits=userSpaceOnUse]
      RenderPath {rect} at (0,0) size 0x0 [fill={[type=SOLID] [color=#FFFFFF]}] [data=&quot;M0.00,0.00 L2147483648.00,0.00 L2147483648.00,2147483648.00 L0.00,2147483648.00 Z&quot;]
    RenderPath {path} at (200,200) size 100x200 [fill={[type=SOLID] [color=#0000FF]}] [data=&quot;M200.00,200.00 L300.00,200.00 L300.00,400.00 L200.00,400.00 Z&quot;]
      [masker=&quot;mask&quot;] RenderSVGResourceMasker {mask} at (190,180) size 214748364800.00x429496729600.00

Expected output: the render tree should look like (note size of first RenderPath object):


layer at (0,0) size 800x600
  RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
  RenderSVGRoot {svg} at (0,0) size 800x600
    RenderSVGResourceMasker {mask} [id=&quot;mask&quot;] [maskUnits=objectBoundingBox] [maskContentUnits=userSpaceOnUse]
      RenderPath {rect} at (0,0) size 800x600 [fill={[type=SOLID] [color=#FFFFFF]}] [data=&quot;M0.00,0.00 L2147483648.00,0.00 L2147483648.00,2147483648.00 L0.00,2147483648.00 Z&quot;]
    RenderPath {path} at (200,200) size 100x200 [fill={[type=SOLID] [color=#0000FF]}] [data=&quot;M200.00,200.00 L300.00,200.00 L300.00,400.00 L200.00,400.00 Z&quot;]
      [masker=&quot;mask&quot;] RenderSVGResourceMasker {mas

Chromium 5.0.395.0 (46220)

Additional information:

The underlying cause appears to be an unsafe float-&gt; int conversion in FloatRect::enclosingIntRect, where static_cast&lt;int&gt; is used on a float outside the range representable by int.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>221926</commentid>
    <comment_count>1</comment_count>
      <attachid>55290</attachid>
    <who name="W. James MacLean">wjmaclean</who>
    <bug_when>2010-05-06 13:33:16 -0700</bug_when>
    <thetext>Created attachment 55290
SVG File with large coordinate values</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>222656</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-05-07 15:15:34 -0700</bug_when>
    <thetext>*** Bug 38680 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>222657</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-05-07 15:16:18 -0700</bug_when>
    <thetext>An explanation of why this is wrong from duplicate:

If you modify mask-excessive-malloc.svg so the rect has dimensions in the range
of int, and dump the results render tree, you will find the size of the
RenderPath (line 6) is 800x600, not 0x0. I.e. it clips to the size of the view
port. If you fix the float -&gt; int conversions so that values greater than the
max int 2147483647 are clipped to 2147483647 (which is one reasonable
approach), then the size will be computed as 800x600. The 0x0 size seems to
occur when very large positive floats get erroneously converted to -2147483648,
which gets clipped to 0 for lengths such as height and width.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>249000</commentid>
    <comment_count>4</comment_count>
    <who name="Nikolas Zimmermann">zimmermann</who>
    <bug_when>2010-07-09 07:25:31 -0700</bug_when>
    <thetext>Changed component to SVG, so it shows up in my all-svg-bugs search.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1239254</commentid>
    <comment_count>5</comment_count>
    <who name="Dirk Schulze">krit</who>
    <bug_when>2016-10-12 05:43:45 -0700</bug_when>
    <thetext>We changed that a long time ago and this particular test passes and we actually do have a test for it in the repo.

However, there might be still problems with huge values. Instead you should use viewBox, transform or similar ways to upscale.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>55290</attachid>
            <date>2010-05-06 13:33:16 -0700</date>
            <delta_ts>2016-10-12 05:41:30 -0700</delta_ts>
            <desc>SVG File with large coordinate values</desc>
            <filename>mask-excessive-malloc.svg</filename>
            <type>image/svg+xml</type>
            <size>289</size>
            <attacher name="W. James MacLean">wjmaclean</attacher>
            
              <data encoding="base64">PD94bWwgdmVyc2lvbj0iMS4wIj8+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAv
c3ZnIj4KPG1hc2sgaWQ9Im1hc2siIHdpZHRoPSIyMTQ3NDgzNjQ3IiBoZWlnaHQ9IjIxNDc0ODM2
NDciPgogICAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjIxNDc0ODM2NDciIGhlaWdodD0iMjE0
NzQ4MzY0NyIgZmlsbD0id2hpdGUiLz4KPC9tYXNrPgo8cGF0aCBtYXNrPSJ1cmwoI21hc2spIiBm
aWxsPSJibHVlIiBkPSJNIDIwMCAyMDAgbCAxMDAgMCBsIDAgMjAwIGwgLTEwMCAwIFoiLz4KPC9z
dmc+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>