Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2092)

Unified Diff: WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp

Issue 521039: Merge 52833 - Public GIF decoder should stop decoding when allocation fails... (Closed) Base URL: svn://chrome-svn/chrome/branches/WebKit/249/
Patch Set: Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
===================================================================
--- WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp (revision 35612)
+++ WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp (working copy)
@@ -331,7 +331,7 @@
return true;
}
-void GIFImageDecoder::haveDecodedRow(unsigned frameIndex,
+bool GIFImageDecoder::haveDecodedRow(unsigned frameIndex,
unsigned char* rowBuffer,
unsigned char* rowEnd,
unsigned rowNumber,
@@ -346,19 +346,19 @@
// Sanity-check the arguments.
if ((rowBuffer == 0) || (y >= size().height()))
- return;
+ return true;
// Get the colormap.
unsigned colorMapSize;
unsigned char* colorMap;
m_reader->getColorMap(colorMap, colorMapSize);
if (!colorMap)
- return;
+ return true;
// Initialize the frame if necessary.
RGBA32Buffer& buffer = m_frameBufferCache[frameIndex];
if ((buffer.status() == RGBA32Buffer::FrameEmpty) && !initFrameBuffer(frameIndex))
- return;
+ return false;
// Write one row's worth of data into the frame. There is no guarantee that
// (rowEnd - rowBuffer) == (size().width() - m_reader->frameXOffset()), so
@@ -386,6 +386,8 @@
// Tell the frame to copy the row data if need be.
if (repeatCount > 1)
buffer.copyRowNTimes(m_reader->frameXOffset(), x, y, std::min(y + static_cast<int>(repeatCount), size().height()));
+
+ return true;
}
void GIFImageDecoder::frameComplete(unsigned frameIndex, unsigned frameDuration, RGBA32Buffer::FrameDisposalMethod disposalMethod)
« no previous file with comments | « WebCore/platform/image-decoders/gif/GIFImageDecoder.h ('k') | WebCore/platform/image-decoders/gif/GIFImageReader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698