Changeset 51789 in webkit


Ignore:
Timestamp:
Dec 7, 2009 12:32:07 PM (14 years ago)
Author:
krit@webkit.org
Message:

2009-12-07 Shiki Okasaka <shiki@google.com>

Reviewed by Dirk Schulze.

Avoid zero division during SVGPaintServerPattern::setup()
https://bugs.webkit.org/show_bug.cgi?id=29912

Fix zero division bugs in SVGPaintServerPattern::setup() that occurred
if the tile of a pattern was bigger than the pattern and the pattern
size was < 0.5, and if the attribute overflow was set to visible.

Test: svg/custom/small-pattern.html

  • svg/graphics/SVGPaintServerPattern.cpp: (WebCore::SVGPaintServerPattern::setup):

2009-12-07 Dirk Schulze <krit@webkit.org>

Reviewed by Adam Barth.

If the tile of a pattern is bigger than the pattern and the
pattern size is < 0.5, the SVGPaintServer produced a division
by zero. This also only happens, if the attribute overflow is
set to visible.
This is a test with a pattern size of 0.1 and a tile size of 1.

  • svg/custom/script-tests/small-pattern.js: Added.
  • svg/custom/small-pattern-expected.txt: Added.
  • svg/custom/small-pattern.html: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r51785 r51789  
     12009-12-07  Dirk Schulze  <krit@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        If the tile of a pattern is bigger than the pattern and the
     6        pattern size is < 0.5, the SVGPaintServer produced a division
     7        by zero. This also only happens, if the attribute overflow is
     8        set to visible.
     9        This is a test with a pattern size of 0.1 and a tile size of 1.
     10
     11        * svg/custom/script-tests/small-pattern.js: Added.
     12        * svg/custom/small-pattern-expected.txt: Added.
     13        * svg/custom/small-pattern.html: Added.
     14
    1152009-12-07  Kenneth Russell  <kbr@google.com>
    216
  • trunk/WebCore/ChangeLog

    r51785 r51789  
     12009-12-07  Shiki Okasaka  <shiki@google.com>
     2
     3        Reviewed by Dirk Schulze.
     4
     5        Avoid zero division during SVGPaintServerPattern::setup()
     6        https://bugs.webkit.org/show_bug.cgi?id=29912
     7
     8        Fix zero division bugs in SVGPaintServerPattern::setup() that occurred
     9        if the tile of a pattern was bigger than the pattern and the pattern
     10        size was < 0.5, and if the attribute overflow was set to visible.
     11
     12        Test: svg/custom/small-pattern.html
     13
     14        * svg/graphics/SVGPaintServerPattern.cpp:
     15        (WebCore::SVGPaintServerPattern::setup):
     16
    1172009-12-07  Kenneth Russell  <kbr@google.com>
    218
  • trunk/WebCore/svg/graphics/SVGPaintServerPattern.cpp

    r51212 r51789  
    123123        GraphicsContext* tileImageContext = tileImage->context();
    124124
    125         int numY = static_cast<int>(ceilf(tileRect.height() / tileHeight)) + 1;
    126         int numX = static_cast<int>(ceilf(tileRect.width() / tileWidth)) + 1;
     125        int numY = static_cast<int>(ceilf(tileRect.height() / patternBoundaries().height())) + 1;
     126        int numX = static_cast<int>(ceilf(tileRect.width() / patternBoundaries().width())) + 1;
    127127
    128128        tileImageContext->save();
Note: See TracChangeset for help on using the changeset viewer.