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

Issue 2252723003: Fix fragmented image signature handling (Closed)

Created:
4 years, 4 months ago by f(malita)
Modified:
4 years, 3 months ago
CC:
chromium-reviews, krit, drott+blinkwatch_chromium.org, blink-reviews-platform-graphics_chromium.org, dshwang, pdr+graphicswatchlist_chromium.org, jbroman, Justin Novosad, Rik, f(malita), blink-reviews, danakj+watch_chromium.org, ajuma+watch_chromium.org, Stephen Chennney, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix fragmented image signature handling ImageDecoder::determineImageType() is currently only examining the first buffer segment (getSomeData). But the signature is not guaranteed to be contiguous, nor do we ever re-consolidate the buffer after receiving more data. As a consequence, when the signature is fragmented (e.g. due to a slow image load), we cannot detect the image type - even after all the data is later received. Refactor determineImageType() to consolidate the signature when needed. BUG=637556 R=pkasting@chromium.org,scroggo@chromium.org,schenney@chromium.org Committed: https://crrev.com/1b80a74055acae8a0296afe644513f52e34dec79 Cr-Commit-Position: refs/heads/master@{#412631}

Patch Set 1 #

Patch Set 2 : minor cleanup #

Total comments: 2

Patch Set 3 : refactor using FastSharedBufferReader #

Total comments: 9

Patch Set 4 : replace useless assert with a comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -10 lines) Patch
M third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTestWoPlatform.cpp View 1 chunk +32 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp View 1 2 3 3 chunks +19 lines, -10 lines 0 comments Download

Messages

Total messages: 32 (20 generated)
f(malita)
scroggo is out this week; pkasting, schenney PTAL. Thanks!
4 years, 4 months ago (2016-08-16 19:49:46 UTC) #7
Stephen Chennney
It looks fine to me but I think a second set of eyes on all ...
4 years, 4 months ago (2016-08-16 20:02:22 UTC) #8
Peter Kasting
https://codereview.chromium.org/2252723003/diff/20001/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp File third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp (right): https://codereview.chromium.org/2252723003/diff/20001/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp#newcode110 third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp:110: namespace { Instead of adding all this, why not ...
4 years, 4 months ago (2016-08-16 20:12:25 UTC) #9
f(malita)
On 2016/08/16 20:02:22, Stephen Chennney wrote: > What do you think the chances are of ...
4 years, 4 months ago (2016-08-16 21:54:03 UTC) #14
Peter Kasting
LGTM https://codereview.chromium.org/2252723003/diff/40001/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp File third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp (right): https://codereview.chromium.org/2252723003/diff/40001/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp#newcode58 third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp:58: return !memcmp(contents, "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A", 8); Random aside: I just ...
4 years, 4 months ago (2016-08-16 22:10:18 UTC) #15
f(malita)
Thanks. https://codereview.chromium.org/2252723003/diff/40001/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp File third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp (right): https://codereview.chromium.org/2252723003/diff/40001/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp#newcode114 third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp:114: static_assert(kLongestSignatureLength == 14, "kLongestSignatureLength mismatch"); On 2016/08/16 22:10:18, ...
4 years, 4 months ago (2016-08-17 17:09:31 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2252723003/60001
4 years, 4 months ago (2016-08-17 20:52:29 UTC) #25
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 4 months ago (2016-08-17 20:57:05 UTC) #27
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/1b80a74055acae8a0296afe644513f52e34dec79 Cr-Commit-Position: refs/heads/master@{#412631}
4 years, 4 months ago (2016-08-17 21:00:20 UTC) #29
Peter Kasting
LGTM https://codereview.chromium.org/2252723003/diff/40001/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp File third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp (right): https://codereview.chromium.org/2252723003/diff/40001/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp#newcode114 third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp:114: static_assert(kLongestSignatureLength == 14, "kLongestSignatureLength mismatch"); On 2016/08/17 17:09:31, ...
4 years, 4 months ago (2016-08-17 22:46:13 UTC) #30
f(malita)
https://codereview.chromium.org/2252723003/diff/40001/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp File third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp (right): https://codereview.chromium.org/2252723003/diff/40001/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp#newcode114 third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp:114: static_assert(kLongestSignatureLength == 14, "kLongestSignatureLength mismatch"); On 2016/08/17 22:46:12, Peter ...
4 years, 4 months ago (2016-08-17 23:19:08 UTC) #31
scroggo_chromium
4 years, 3 months ago (2016-09-06 19:21:07 UTC) #32
Message was sent while issue was closed.
lgtm

Powered by Google App Engine
This is Rietveld 408576698