Changeset 75975 in webkit


Ignore:
Timestamp:
Jan 17, 2011, 3:14:18 PM (14 years ago)
Author:
mitz@apple.com
Message:

Use of invalid hash map key in CSSFontFaceSource::getFontData() with 0-sized remote font
https://bugs.webkit.org/show_bug.cgi?id=52598

Reviewed by Darin Adler.

Source/WebCore:

Test: fast/css/font-face-zero-hash-key.html

  • css/CSSFontFaceSource.cpp:

(WebCore::CSSFontFaceSource::getFontData): Add 1 to the font size to avoid a 0 hash key.

  • css/CSSSegmentedFontFace.cpp:

(WebCore::CSSSegmentedFontFace::getFontData): Ditto.

LayoutTests:

  • fast/css/font-face-zero-hash-key-expected.txt: Added.
  • fast/css/font-face-zero-hash-key.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r75973 r75975  
     12011-01-17  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Use of invalid hash map key in CSSFontFaceSource::getFontData() with 0-sized remote font
     6        https://bugs.webkit.org/show_bug.cgi?id=52598
     7
     8        * fast/css/font-face-zero-hash-key-expected.txt: Added.
     9        * fast/css/font-face-zero-hash-key.html: Added.
     10
    1112011-01-17  Helder Correia  <helder@sencha.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r75974 r75975  
     12011-01-17  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Use of invalid hash map key in CSSFontFaceSource::getFontData() with 0-sized remote font
     6        https://bugs.webkit.org/show_bug.cgi?id=52598
     7
     8        Test: fast/css/font-face-zero-hash-key.html
     9
     10        * css/CSSFontFaceSource.cpp:
     11        (WebCore::CSSFontFaceSource::getFontData): Add 1 to the font size to avoid a 0 hash key.
     12        * css/CSSSegmentedFontFace.cpp:
     13        (WebCore::CSSSegmentedFontFace::getFontData): Ditto.
     14
    1152011-01-17  David Kilzer  <ddkilzer@apple.com>
    216
  • trunk/Source/WebCore/css/CSSFontFaceSource.cpp

    r73258 r75975  
    116116
    117117    // See if we have a mapping in our FontData cache.
    118     unsigned hashKey = fontDescription.computedPixelSize() << 3 | (fontDescription.orientation() == Vertical ? 4 : 0) | (syntheticBold ? 2 : 0) | (syntheticItalic ? 1 : 0);
     118    unsigned hashKey = (fontDescription.computedPixelSize() + 1) << 3 | (fontDescription.orientation() == Vertical ? 4 : 0) | (syntheticBold ? 2 : 0) | (syntheticItalic ? 1 : 0);
    119119    if (SimpleFontData* cachedData = m_fontDataTable.get(hashKey))
    120120        return cachedData;
  • trunk/Source/WebCore/css/CSSSegmentedFontFace.cpp

    r71970 r75975  
    8989
    9090    FontTraitsMask desiredTraitsMask = fontDescription.traitsMask();
    91     unsigned hashKey = (fontDescription.computedPixelSize() << (FontTraitsMaskWidth + 1)) | ((fontDescription.orientation() == Vertical ? 1 : 0) << FontTraitsMaskWidth) | desiredTraitsMask;
     91    unsigned hashKey = ((fontDescription.computedPixelSize() + 1) << (FontTraitsMaskWidth + 1)) | ((fontDescription.orientation() == Vertical ? 1 : 0) << FontTraitsMaskWidth) | desiredTraitsMask;
    9292
    9393    SegmentedFontData* fontData = m_fontDataTable.get(hashKey);
Note: See TracChangeset for help on using the changeset viewer.