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

Issue 22841005: Remove dependency on getLength from webp decoder. (Closed)

Created:
7 years, 4 months ago by scroggo
Modified:
7 years, 4 months ago
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

Remove dependency on getLength from webp decoder. In webp_parse_header, continue reading until end of stream is reached, or we have read WEBP_VP8_HEADER_SIZE bytes. Do not check to see if the stream was too short, since it may not have a way to report its length, and WEBP_VP8_HEADER_SIZE is padded slightly. Instead, depend on WebPGetFeatures to report that the stream did not have enough data. In webp_idecode, only check length if it is available. BUG=https://b.corp.google.com/issue?id=8432093 R=djsollen@google.com, vikasa@google.com Committed: https://code.google.com/p/skia/source/detail?r=10848

Patch Set 1 #

Total comments: 6

Patch Set 2 : Check for eof if no bytes are read. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -11 lines) Patch
M src/images/SkImageDecoder_libwebp.cpp View 1 2 chunks +18 lines, -11 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
scroggo
7 years, 4 months ago (2013-08-12 17:40:06 UTC) #1
djsollen
Craig, just wanted to give you a heads up as I think this CL is ...
7 years, 4 months ago (2013-08-12 17:47:21 UTC) #2
djsollen
lgtm
7 years, 4 months ago (2013-08-12 17:47:32 UTC) #3
djsollen
retracting my l*tm as I missed this. https://codereview.chromium.org/22841005/diff/1/src/images/SkImageDecoder_libwebp.cpp File src/images/SkImageDecoder_libwebp.cpp (right): https://codereview.chromium.org/22841005/diff/1/src/images/SkImageDecoder_libwebp.cpp#newcode68 src/images/SkImageDecoder_libwebp.cpp:68: if ((size_t)-1 ...
7 years, 4 months ago (2013-08-12 17:54:57 UTC) #4
vikasa
https://codereview.chromium.org/22841005/diff/1/src/images/SkImageDecoder_libwebp.cpp File src/images/SkImageDecoder_libwebp.cpp (right): https://codereview.chromium.org/22841005/diff/1/src/images/SkImageDecoder_libwebp.cpp#newcode75 src/images/SkImageDecoder_libwebp.cpp:75: } while (!stream->isAtEnd() && bytesToRead > 0); Assumption here ...
7 years, 4 months ago (2013-08-12 18:25:40 UTC) #5
vikasa
On 2013/08/12 18:25:40, vikasa wrote: > https://codereview.chromium.org/22841005/diff/1/src/images/SkImageDecoder_libwebp.cpp > File src/images/SkImageDecoder_libwebp.cpp (right): > > https://codereview.chromium.org/22841005/diff/1/src/images/SkImageDecoder_libwebp.cpp#newcode75 > ...
7 years, 4 months ago (2013-08-12 18:26:17 UTC) #6
scroggo
https://codereview.chromium.org/22841005/diff/1/src/images/SkImageDecoder_libwebp.cpp File src/images/SkImageDecoder_libwebp.cpp (right): https://codereview.chromium.org/22841005/diff/1/src/images/SkImageDecoder_libwebp.cpp#newcode202 src/images/SkImageDecoder_libwebp.cpp:202: SkTMin(stream->getLength(), WEBP_IDECODE_BUFFER_SZ) : WEBP_IDECODE_BUFFER_SZ; On 2013/08/12 18:25:41, vikasa wrote: ...
7 years, 4 months ago (2013-08-12 18:44:57 UTC) #7
djsollen
https://codereview.chromium.org/22841005/diff/1/src/images/SkImageDecoder_libwebp.cpp File src/images/SkImageDecoder_libwebp.cpp (right): https://codereview.chromium.org/22841005/diff/1/src/images/SkImageDecoder_libwebp.cpp#newcode75 src/images/SkImageDecoder_libwebp.cpp:75: } while (!stream->isAtEnd() && bytesToRead > 0); On 2013/08/12 ...
7 years, 4 months ago (2013-08-12 18:46:52 UTC) #8
vikasa
lgtm
7 years, 4 months ago (2013-08-12 19:01:20 UTC) #9
scroggo
New patch up https://codereview.chromium.org/22841005/diff/1/src/images/SkImageDecoder_libwebp.cpp File src/images/SkImageDecoder_libwebp.cpp (right): https://codereview.chromium.org/22841005/diff/1/src/images/SkImageDecoder_libwebp.cpp#newcode68 src/images/SkImageDecoder_libwebp.cpp:68: if ((size_t)-1 == bytesRead) { On ...
7 years, 4 months ago (2013-08-12 19:08:10 UTC) #10
djsollen
lgtm
7 years, 4 months ago (2013-08-12 19:32:50 UTC) #11
scroggo
7 years, 4 months ago (2013-08-21 14:56:15 UTC) #12
Message was sent while issue was closed.
Committed patchset #2 manually as r10848 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698