Changeset 152228 in webkit


Ignore:
Timestamp:
Jul 1, 2013 9:38:05 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[Win] Crash when scrolling page with images.
https://bugs.webkit.org/show_bug.cgi?id=117832

Patch by peavo@outlook.com <peavo@outlook.com> on 2013-07-01
Reviewed by Brent Fulgham.

Avoid access violation by returning early from method if image frame doesn't have pixel data.

  • platform/image-decoders/ImageDecoder.h:

(WebCore::ImageFrame::hasPixelData): Added method to check if frame has pixel data.

  • platform/image-decoders/gif/GIFImageDecoder.cpp:

(WebCore::GIFImageDecoder::haveDecodedRow): Early return if frame doesn't have pixel data.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r152227 r152228  
     12013-07-01  peavo@outlook.com  <peavo@outlook.com>
     2
     3        [Win] Crash when scrolling page with images.
     4        https://bugs.webkit.org/show_bug.cgi?id=117832
     5
     6        Reviewed by Brent Fulgham.
     7
     8        Avoid access violation by returning early from method if image frame doesn't have pixel data.
     9
     10        * platform/image-decoders/ImageDecoder.h:
     11        (WebCore::ImageFrame::hasPixelData): Added method to check if frame has pixel data.
     12        * platform/image-decoders/gif/GIFImageDecoder.cpp:
     13        (WebCore::GIFImageDecoder::haveDecodedRow): Early return if frame doesn't have pixel data.
     14
    1152013-07-01  Noam Rosenthal  <noam@webkit.org>
    216
  • trunk/Source/WebCore/platform/image-decoders/ImageDecoder.h

    r151957 r152228  
    134134        }
    135135
     136        inline bool hasPixelData() const
     137        {
     138            return m_bytes;
     139        }
     140
    136141        // Use fix point multiplier instead of integer division or floating point math.
    137142        // This multipler produces exactly the same result for all values in range 0 - 255.
  • trunk/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp

    r151957 r152228  
    228228    // Initialize the frame if necessary.
    229229    ImageFrame& buffer = m_frameBufferCache[frameIndex];
    230     if ((buffer.status() == ImageFrame::FrameEmpty) && !initFrameBuffer(frameIndex))
     230    if (((buffer.status() == ImageFrame::FrameEmpty) && !initFrameBuffer(frameIndex)) || !buffer.hasPixelData())
    231231        return false;
    232232
Note: See TracChangeset for help on using the changeset viewer.