Skip to content

Commit

Permalink
REGRESSION(276827@main): Large animated images may not animate all th…
Browse files Browse the repository at this point in the history
…e frames

https://bugs.webkit.org/show_bug.cgi?id=274478
rdar://127697287

Reviewed by Simon Fraser.

We used to postpone animating the image till loading the image is complete. The
number of frames can only be known for sure when the loading the encoded data is
complete. If we start animating before we get all the data, we may end up
animating a small set of the image frames.

The fix is to postpone animating the animated image till its encoded data is
completely loaded.

* Source/WebCore/platform/graphics/BitmapImageSource.cpp:
(WebCore::BitmapImageSource::frameAnimator const):

Canonical link: https://commits.webkit.org/279090@main
  • Loading branch information
shallawa authored and Said Abou-Hallawa committed May 22, 2024
1 parent 6cfd378 commit fab9c4b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/WebCore/platform/graphics/BitmapImageSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ ImageFrameAnimator* BitmapImageSource::frameAnimator() const
if (m_frameAnimator)
return m_frameAnimator.get();

// Number of frames can only be known for sure when loadimg the image is complete.
if (encodedDataStatus() != EncodedDataStatus::Complete)
return nullptr;

if (!isAnimated())
return nullptr;

Expand Down

0 comments on commit fab9c4b

Please sign in to comment.