Changeset 102519 in webkit


Ignore:
Timestamp:
Dec 10, 2011 1:54:37 AM (12 years ago)
Author:
noel.gordon@gmail.com
Message:

WebPImageDecoder progressive decodes fail to decode valid images
https://bugs.webkit.org/show_bug.cgi?id=74062

Reviewed by Adam Barth.

The WEBP header is followed by a so-called P0 header, then some data to
decode. If a partial P0 header is received during progressive decodes,
WebPIDecGetRGB() returns false; that makes the decoder enter the failed
state, no image appears on the page.

James Zern (webp) recommended the following via e-mail:

WebPIUpdate() validates input data, and will return an error status for
malformed data (bit-stream error, invalid data). Otherwise, it returns
OK or SUSPENDED. OK means that decoding is done/complete/no-error, and
SUSPENDED means more input data is needed to complete decoding. A NULL
return from WebPIDecGetRGB() is valid at this time due to a partial P0,
and should not be interpreted as a decoding failure.

No new tests. Not something DumpRenderTree can easily test.

  • platform/image-decoders/webp/WEBPImageDecoder.cpp:

(WebCore::WEBPImageDecoder::decode): A NULL WebPIDecGetRGB() return is
acceptable here. Return false instead of failing the decoder.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r102517 r102519  
     12011-12-10  Noel Gordon  <noel.gordon@gmail.com>
     2
     3        WebPImageDecoder progressive decodes fail to decode valid images
     4        https://bugs.webkit.org/show_bug.cgi?id=74062
     5
     6        Reviewed by Adam Barth.
     7
     8        The WEBP header is followed by a so-called P0 header, then some data to
     9        decode.  If a partial P0 header is received during progressive decodes,
     10        WebPIDecGetRGB() returns false; that makes the decoder enter the failed
     11        state, no image appears on the page.
     12
     13        James Zern (webp) recommended the following via e-mail:
     14
     15        WebPIUpdate() validates input data, and will return an error status for
     16        malformed data (bit-stream error, invalid data).  Otherwise, it returns
     17        OK or SUSPENDED.  OK means that decoding is done/complete/no-error, and
     18        SUSPENDED means more input data is needed to complete decoding.  A NULL
     19        return from WebPIDecGetRGB() is valid at this time due to a partial P0,
     20        and should not be interpreted as a decoding failure.
     21
     22        No new tests. Not something DumpRenderTree can easily test.
     23
     24        * platform/image-decoders/webp/WEBPImageDecoder.cpp:
     25        (WebCore::WEBPImageDecoder::decode):  A NULL WebPIDecGetRGB() return is
     26        acceptable here.  Return false instead of failing the decoder.
     27
    1282011-12-09  Benjamin Poulain  <bpoulain@apple.com>
    229
  • trunk/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp

    r102310 r102519  
    135135            return setFailed();
    136136        if (!WebPIDecGetRGB(m_decoder, &newLastVisibleRow, 0, 0, 0))
    137             return setFailed();
     137            return false;
    138138        ASSERT(newLastVisibleRow >= 0);
    139139        ASSERT(newLastVisibleRow <= height);
Note: See TracChangeset for help on using the changeset viewer.