Changeset 122368 in webkit


Ignore:
Timestamp:
Jul 11, 2012 2:03:49 PM (12 years ago)
Author:
kseo@webkit.org
Message:

BitmapImage::frameIsCompleteAtIndex() must return false if ImageDecoder is not initialized.
https://bugs.webkit.org/show_bug.cgi?id=90757

Patch by Huang Dongsung <luxtella@company100.net> on 2012-07-11
Reviewed by Simon Fraser.

The current code fortunately has worked so far because only
BitmapImage::startAnimation calls frameIsCompleteAtIndex, and startAnimation
cannot call frameIsCompleteAtIndex if ImageDecoder is not yet initialized.
startAnimation returns at the first line becase shouldAnimate() always return
false in this case.

if (m_frameTimer
!shouldAnimate() frameCount() <= 1)

return;

This change is needed because parallel image decoders call
BitmapImage::frameIsCompleteAtIndex in other places too.

No new tests, manually tested whether the caller exists or not that
calls BitmapImage::frameIsCompleteAtIndex() before ImageDecoder is
initialized.

  • platform/graphics/BitmapImage.cpp:

(WebCore::BitmapImage::frameIsCompleteAtIndex):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r122363 r122368  
     12012-07-11  Huang Dongsung  <luxtella@company100.net>
     2
     3        BitmapImage::frameIsCompleteAtIndex() must return false if ImageDecoder is not initialized.
     4        https://bugs.webkit.org/show_bug.cgi?id=90757
     5
     6        Reviewed by Simon Fraser.
     7
     8        The current code fortunately has worked so far because only
     9        BitmapImage::startAnimation calls frameIsCompleteAtIndex, and startAnimation
     10        cannot call frameIsCompleteAtIndex if ImageDecoder is not yet initialized.
     11        startAnimation returns at the first line becase shouldAnimate() always return
     12        false in this case.
     13
     14            if (m_frameTimer || !shouldAnimate() || frameCount() <= 1)
     15                return;
     16
     17        This change is needed because parallel image decoders call
     18        BitmapImage::frameIsCompleteAtIndex in other places too.
     19
     20        No new tests, manually tested whether the caller exists or not that
     21        calls BitmapImage::frameIsCompleteAtIndex() before ImageDecoder is
     22        initialized.
     23
     24        * platform/graphics/BitmapImage.cpp:
     25        (WebCore::BitmapImage::frameIsCompleteAtIndex):
     26
    1272012-07-11  Kevin Ollivier  <kevino@theolliviers.com>
    228
  • trunk/Source/WebCore/platform/graphics/BitmapImage.cpp

    r122269 r122368  
    305305{
    306306    if (!ensureFrameIsCached(index))
    307         return true; // Why would an invalid index return true here?
     307        return false;
    308308    return m_frames[index].m_isComplete;
    309309}
Note: See TracChangeset for help on using the changeset viewer.