Changeset 190597 in webkit


Ignore:
Timestamp:
Oct 5, 2015 6:22:48 PM (8 years ago)
Author:
commit-queue@webkit.org
Message:

CSSGradientValue should check whether gradientLength is zero or not.
https://bugs.webkit.org/show_bug.cgi?id=149373
<rdar://problem/22771418>

Patch by Jiewen Tan <jiewen_tan@apple.com> on 2015-10-05
Reviewed by Darin Adler.

Source/WebCore:

This is a merge of Blink r158220,
https://chromiumcodereview.appspot.com/24350008

Test: fast/gradients/css3-repeating-radial-gradients-crash.html

  • css/CSSGradientValue.cpp:

(WebCore::CSSGradientValue::addStops):
Check whether gradientLength > 0 before using it as denominator.

LayoutTests:

  • fast/gradients/css3-repeating-radial-gradients-crash-expected.txt: Added.
  • fast/gradients/css3-repeating-radial-gradients-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r190595 r190597  
     12015-10-05  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        CSSGradientValue should check whether gradientLength is zero or not.
     4        https://bugs.webkit.org/show_bug.cgi?id=149373
     5        <rdar://problem/22771418>
     6
     7        Reviewed by Darin Adler.
     8
     9        * fast/gradients/css3-repeating-radial-gradients-crash-expected.txt: Added.
     10        * fast/gradients/css3-repeating-radial-gradients-crash.html: Added.
     11
    1122015-10-05  Dean Jackson  <dino@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r190595 r190597  
     12015-10-05  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        CSSGradientValue should check whether gradientLength is zero or not.
     4        https://bugs.webkit.org/show_bug.cgi?id=149373
     5        <rdar://problem/22771418>
     6
     7        Reviewed by Darin Adler.
     8
     9        This is a merge of Blink r158220,
     10        https://chromiumcodereview.appspot.com/24350008
     11
     12        Test: fast/gradients/css3-repeating-radial-gradients-crash.html
     13
     14        * css/CSSGradientValue.cpp:
     15        (WebCore::CSSGradientValue::addStops):
     16        Check whether gradientLength > 0 before using it as denominator.
     17
    1182015-10-05  Dean Jackson  <dino@apple.com>
    219
  • trunk/Source/WebCore/css/CSSGradientValue.cpp

    r188315 r190597  
    376376
    377377                if (maxLengthForRepeat > gradientLength)
    378                     maxExtent = maxLengthForRepeat / gradientLength;
     378                    maxExtent = gradientLength > 0 ? maxLengthForRepeat / gradientLength : 0;
    379379            }
    380380
Note: See TracChangeset for help on using the changeset viewer.