Commit f83ed479 authored by cblume's avatar cblume Committed by Commit bot

Purge image frame after checking for sufficient data.

It is possible to only have some of the image downloaded and attempt to
display an animation frame at the end. When this happens, we would purge
important frames.

BUG=652046

Review-Url: https://codereview.chromium.org/2382143004
Cr-Commit-Position: refs/heads/master@{#422605}
parent 1a97ab74
...@@ -335,12 +335,12 @@ void GIFImageDecoder::decode(size_t index) { ...@@ -335,12 +335,12 @@ void GIFImageDecoder::decode(size_t index) {
return; return;
} }
if (m_purgeAggressively)
clearCacheExceptFrame(*i);
// We need more data to continue decoding. // We need more data to continue decoding.
if (m_frameBufferCache[*i].getStatus() != ImageFrame::FrameComplete) if (m_frameBufferCache[*i].getStatus() != ImageFrame::FrameComplete)
break; break;
if (m_purgeAggressively)
clearCacheExceptFrame(*i);
} }
// It is also a fatal error if all data is received and we have decoded all // It is also a fatal error if all data is received and we have decoded all
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment