Changeset 51517 in webkit


Ignore:
Timestamp:
Nov 30, 2009 3:55:38 PM (14 years ago)
Author:
Beth Dakin
Message:

WebCore: Fix for https://bugs.webkit.org/show_bug.cgi?id=32000 Crash in
Safari caused by extreme column-gap and column-width values
-and corresponding-
<rdar://problem/7425433>

Reviewed by Oliver Hunt.

Prevent desiredColumnCount from being less than 1 since it is used
as a divisor.

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::calcColumnWidth):

LayoutTests: Test for https://bugs.webkit.org/show_bug.cgi?id=32000 Crash in
Safari caused by extreme column-gap and column-width values
-and corresponding-
<rdar://problem/7425433>

Reviewed by Oliver Hunt.

  • fast/multicol/huge-column-gap-crash-expected.txt: Added.
  • fast/multicol/huge-column-gap-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r51516 r51517  
     12009-11-30  Beth Dakin  <bdakin@apple.com>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        Test for https://bugs.webkit.org/show_bug.cgi?id=32000 Crash in
     6        Safari caused by extreme column-gap and column-width values
     7        -and corresponding-
     8        <rdar://problem/7425433>
     9
     10        * fast/multicol/huge-column-gap-crash-expected.txt: Added.
     11        * fast/multicol/huge-column-gap-crash.html: Added.
     12
    1132009-11-30  Alexey Proskuryakov  <ap@apple.com>
    214
  • trunk/WebCore/ChangeLog

    r51516 r51517  
     12009-11-30  Beth Dakin  <bdakin@apple.com>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        Fix for https://bugs.webkit.org/show_bug.cgi?id=32000 Crash in
     6        Safari caused by extreme column-gap and column-width values
     7        -and corresponding-
     8        <rdar://problem/7425433>
     9
     10        Prevent desiredColumnCount from being less than 1 since it is used
     11        as a divisor.
     12        * rendering/RenderBlock.cpp:
     13        (WebCore::RenderBlock::calcColumnWidth):
     14
    1152009-11-30  Alexey Proskuryakov  <ap@apple.com>
    216
  • trunk/WebCore/rendering/RenderBlock.cpp

    r51429 r51517  
    35543554        } else if (colGap < availWidth) {
    35553555            desiredColumnCount = availWidth / colGap;
     3556            if (desiredColumnCount < 1)
     3557                desiredColumnCount = 1;
    35563558            desiredColumnWidth = (availWidth - (desiredColumnCount - 1) * colGap) / desiredColumnCount;
    35573559        }
     
    35593561        if (colWidth < availWidth) {
    35603562            desiredColumnCount = (availWidth + colGap) / (colWidth + colGap);
     3563            if (desiredColumnCount < 1)
     3564                desiredColumnCount = 1;
    35613565            desiredColumnWidth = (availWidth - (desiredColumnCount - 1) * colGap) / desiredColumnCount;
    35623566        }
     
    35683572        } else if (colWidth < availWidth) {
    35693573            desiredColumnCount = (availWidth + colGap) / (colWidth + colGap);
     3574            if (desiredColumnCount < 1)
     3575                desiredColumnCount = 1;
    35703576            desiredColumnWidth = (availWidth - (desiredColumnCount - 1) * colGap) / desiredColumnCount;
    35713577        }
Note: See TracChangeset for help on using the changeset viewer.