[webkit-reviews] review granted: [Bug 111137] More cleanup in GIFImageReader : [Attachment 191384] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Mar 6 08:26:01 PST 2013
Stephen White <senorblanco at chromium.org> has granted Hin-Chung Lam
<hclam at google.com>'s request for review:
Bug 111137: More cleanup in GIFImageReader
https://bugs.webkit.org/show_bug.cgi?id=111137
Attachment 191384: Patch
https://bugs.webkit.org/attachment.cgi?id=191384&action=review
------- Additional Comments from Stephen White <senorblanco at chromium.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=191384&action=review
Looks good. r=me
> Source/WebCore/platform/image-decoders/gif/GIFImageReader.cpp:392
> m_frameContext->datasize = datasize;
> - m_frameContext->clearCode = clearCode;
> - m_frameContext->avail = m_frameContext->clearCode + 2;
> - m_frameContext->oldcode = -1;
> - m_frameContext->codesize = m_frameContext->datasize + 1;
> - m_frameContext->codemask = (1 << m_frameContext->codesize) -
1;
> - m_frameContext->datum = m_frameContext->bits = 0;
> -
> - // Init the tables.
> - if (!m_frameContext->suffix)
> - m_frameContext->suffix = new unsigned char[MAX_BITS];
> -
> - // Clearing the whole suffix table lets us be more tolerant
of bad data.
> - memset(m_frameContext->suffix, 0, MAX_BITS);
> - for (int i = 0; i < m_frameContext->clearCode; i++)
> - m_frameContext->suffix[i] = i;
> -
> - if (!m_frameContext->stack)
> - m_frameContext->stack = new unsigned char[MAX_BITS];
> - m_frameContext->stackp = m_frameContext->stack;
> + // Initialize LZW parser/decoder.
> + if (!m_lzwContext.prepareToDecode(m_screenWidth, datasize))
> + return m_client ? m_client->setFailed() : false;
Not sure if it's a problem, but in the error case, this code previously used to
early-return before m_frameContext->datasize was set. Now it'll be set
unconditionally.
More information about the webkit-reviews
mailing list