| Index: Source/platform/graphics/BitmapImage.cpp
|
| diff --git a/Source/platform/graphics/BitmapImage.cpp b/Source/platform/graphics/BitmapImage.cpp
|
| index e324ae2238771132d93295642084fe0955851313..29995ff9d0d3cbdbe299b4ece3a98803e0a9dea3 100644
|
| --- a/Source/platform/graphics/BitmapImage.cpp
|
| +++ b/Source/platform/graphics/BitmapImage.cpp
|
| @@ -139,8 +139,16 @@ void BitmapImage::destroyDecodedDataIfNecessary()
|
| // to one frame at a time.
|
| static const size_t cLargeAnimationCutoff = 5242880;
|
| size_t allFrameBytes = 0;
|
| - for (size_t i = 0; i < m_frames.size(); ++i)
|
| + for (size_t i = 0; i < m_frames.size(); ++i) {
|
| + // The memory for lazy-decoded frames is managed externally.
|
| + if (m_frames[i].m_frame && m_frames[i].m_frame->isLazyGenerated()) {
|
| + // We don't mix lazy/non-lazy frames.
|
| + ASSERT(!allFrameBytes);
|
| + break;
|
| + }
|
| +
|
| allFrameBytes += m_frames[i].m_frameBytes;
|
| + }
|
|
|
| if (allFrameBytes > cLargeAnimationCutoff) {
|
| destroyDecodedData(false);
|
|
|