Chromium Code Reviews| Index: third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp |
| diff --git a/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp |
| index 914def5256a8fb57e0b10d6391df3ad6771b1441..04f77db320d55bf62352fec3ffcc6ac3d5fa99f5 100644 |
| --- a/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp |
| +++ b/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp |
| @@ -235,6 +235,9 @@ bool WEBPImageDecoder::updateDemuxer() { |
| if (!setSize(width, height)) |
| return setFailed(); |
| + size_t frameCount = WebPDemuxGetI(m_demux, WEBP_FF_FRAME_COUNT); |
|
urvang
2016/10/10 21:30:50
No, this is not the right place. "!isDecodedSizeAv
cblume
2016/10/10 21:36:38
Done.
|
| + updateAggressivePurging(frameCount); |
| + |
| m_formatFlags = WebPDemuxGetI(m_demux, WEBP_FF_FORMAT_FLAGS); |
| if (!(m_formatFlags & ANIMATION_FLAG)) { |
| m_repetitionCount = cAnimationNone; |
| @@ -486,6 +489,9 @@ void WEBPImageDecoder::decode(size_t index) { |
| // We need more data to continue decoding. |
| if (m_frameBufferCache[*i].getStatus() != ImageFrame::FrameComplete) |
| break; |
| + |
| + if (m_purgeAggressively) |
| + clearCacheExceptFrame(*i); |
| } |
| // It is also a fatal error if all data is received and we have decoded all |