Changeset 158840 in webkit


Ignore:
Timestamp:
Nov 7, 2013 3:04:16 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Fix crash in BitmapImage::destroyDecodedData()
https://bugs.webkit.org/show_bug.cgi?id=116494

Patch by Laszlo Vidacs <lac@inf.u-szeged.hu> on 2013-11-07
Reviewed by Csaba Osztrogonác.

Merge from https://chromium.googlesource.com/chromium/blink/+/6b6887bf53068f8537908e501fdc7317ad2c6d86

  • platform/graphics/BitmapImage.cpp:

(WebCore::BitmapImage::destroyDecodedData):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r158839 r158840  
     12013-11-07  Laszlo Vidacs  <lac@inf.u-szeged.hu>
     2       
     3        Fix crash in BitmapImage::destroyDecodedData()
     4        https://bugs.webkit.org/show_bug.cgi?id=116494
     5
     6        Reviewed by Csaba Osztrogonác.
     7
     8        Merge from https://chromium.googlesource.com/chromium/blink/+/6b6887bf53068f8537908e501fdc7317ad2c6d86
     9
     10        * platform/graphics/BitmapImage.cpp:
     11        (WebCore::BitmapImage::destroyDecodedData):
     12
    1132013-11-06  Sergio Villar Senin  <svillar@igalia.com>
    214
  • trunk/Source/WebCore/platform/graphics/BitmapImage.cpp

    r158659 r158840  
    7878    unsigned frameBytesCleared = 0;
    7979    const size_t clearBeforeFrame = destroyAll ? m_frames.size() : m_currentFrame;
    80     for (size_t i = 0; i < clearBeforeFrame; ++i) {
     80
     81    // Because we can advance frames without always needing to decode the actual
     82    // bitmap data, |m_currentFrame| may be larger than m_frames.size();
     83    // make sure not to walk off the end of the container in this case.
     84    for (size_t i = 0; i <  std::min(clearBeforeFrame, m_frames.size()); ++i) {
    8185        // The underlying frame isn't actually changing (we're just trying to
    8286        // save the memory for the framebuffer data), so we don't need to clear
Note: See TracChangeset for help on using the changeset viewer.