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

Issue 1308273011: Handle zero-length encoded images gracefully during deserialization (Closed)

Created:
5 years, 3 months ago by f(malita)
Modified:
5 years, 3 months ago
CC:
reviews_skia.org
Base URL:
https://chromium.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Handle zero-length encoded images gracefully during deserialization Image encoding may fail during serialization, resulting in zero-length encoded data in the SKP. Instead of invalidating the stream (and preventing deserialization of the whole picture) we can instantiate placeholder images. BUG=skia:4285 R=reed@google.com,robertphillips@google.com Committed: https://skia.googlesource.com/skia/+/c3470340b6658dea7baa3ac90d3b716c0afd7051

Patch Set 1 #

Patch Set 2 : extra tests #

Total comments: 2

Patch Set 3 : drop the checkerboard #

Patch Set 4 : use an image generator #

Total comments: 2

Patch Set 5 : generator comments #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+73 lines, -7 lines) Patch
M include/core/SkPicture.h View 1 chunk +1 line, -3 lines 1 comment Download
M src/core/SkPictureData.cpp View 1 2 3 4 3 chunks +22 lines, -1 line 1 comment Download
M src/core/SkWriteBuffer.cpp View 1 chunk +1 line, -1 line 0 comments Download
M tests/ImageTest.cpp View 1 2 chunks +49 lines, -2 lines 0 comments Download

Messages

Total messages: 31 (10 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1308273011/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1308273011/20001
5 years, 3 months ago (2015-09-04 17:09:52 UTC) #2
f(malita)
5 years, 3 months ago (2015-09-04 17:12:31 UTC) #3
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 3 months ago (2015-09-04 17:14:35 UTC) #5
reed1
https://codereview.chromium.org/1308273011/diff/20001/src/core/SkPictureData.cpp File src/core/SkPictureData.cpp (right): https://codereview.chromium.org/1308273011/diff/20001/src/core/SkPictureData.cpp#newcode472 src/core/SkPictureData.cpp:472: return make_checkerboard_image(width, height); This seems odd to me, partly ...
5 years, 3 months ago (2015-09-04 17:26:24 UTC) #6
reed1
5 years, 3 months ago (2015-09-04 17:26:46 UTC) #7
f(malita)
https://codereview.chromium.org/1308273011/diff/20001/src/core/SkPictureData.cpp File src/core/SkPictureData.cpp (right): https://codereview.chromium.org/1308273011/diff/20001/src/core/SkPictureData.cpp#newcode472 src/core/SkPictureData.cpp:472: return make_checkerboard_image(width, height); On 2015/09/04 17:26:24, reed1 wrote: > ...
5 years, 3 months ago (2015-09-04 17:50:41 UTC) #8
f(malita)
On 2015/09/04 17:50:41, f(malita) wrote: > One option is to allocate a picture-backed SkImage which ...
5 years, 3 months ago (2015-09-04 17:59:29 UTC) #9
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1308273011/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1308273011/40001
5 years, 3 months ago (2015-09-04 18:00:36 UTC) #11
reed1
Agreed, I don't want us to fail to load the SKP, but its not clear ...
5 years, 3 months ago (2015-09-04 18:04:39 UTC) #12
reed1
Perhaps an advantage over the picture one, is that this one won't commit any RAM ...
5 years, 3 months ago (2015-09-04 18:05:24 UTC) #13
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 3 months ago (2015-09-04 18:05:51 UTC) #15
f(malita)
On 2015/09/04 18:04:39, reed1 wrote: > If we don't want to return NULL, perhaps an ...
5 years, 3 months ago (2015-09-04 18:15:49 UTC) #16
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1308273011/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1308273011/60001
5 years, 3 months ago (2015-09-04 18:16:08 UTC) #18
reed1
lgtm w/ comment suggestion https://codereview.chromium.org/1308273011/diff/60001/src/core/SkPictureData.cpp File src/core/SkPictureData.cpp (right): https://codereview.chromium.org/1308273011/diff/60001/src/core/SkPictureData.cpp#newcode439 src/core/SkPictureData.cpp:439: class EmptyImageGenerator final : public ...
5 years, 3 months ago (2015-09-04 18:17:27 UTC) #19
f(malita)
https://codereview.chromium.org/1308273011/diff/60001/src/core/SkPictureData.cpp File src/core/SkPictureData.cpp (right): https://codereview.chromium.org/1308273011/diff/60001/src/core/SkPictureData.cpp#newcode439 src/core/SkPictureData.cpp:439: class EmptyImageGenerator final : public SkImageGenerator { On 2015/09/04 ...
5 years, 3 months ago (2015-09-04 18:23:54 UTC) #21
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1308273011/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1308273011/80001
5 years, 3 months ago (2015-09-04 18:24:00 UTC) #22
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 3 months ago (2015-09-04 18:29:02 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1308273011/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1308273011/80001
5 years, 3 months ago (2015-09-04 18:36:00 UTC) #27
commit-bot: I haz the power
Committed patchset #5 (id:80001) as https://skia.googlesource.com/skia/+/c3470340b6658dea7baa3ac90d3b716c0afd7051
5 years, 3 months ago (2015-09-04 18:36:42 UTC) #28
scroggo
LGTM https://codereview.chromium.org/1308273011/diff/80001/include/core/SkPicture.h File include/core/SkPicture.h (right): https://codereview.chromium.org/1308273011/diff/80001/include/core/SkPicture.h#newcode106 include/core/SkPicture.h:106: * bitmaps and images in the picture. I ...
5 years, 3 months ago (2015-09-04 18:48:20 UTC) #30
reed1
5 years, 3 months ago (2015-09-04 18:58:37 UTC) #31
Message was sent while issue was closed.
red: yea, that's sort of where I was going when I wondered about the "heuristic"
of drawing checker-board-vs-nothing-vs-? Perhaps in the future the
runtime-options passed to picture_deserialize could take over that aspect.

Powered by Google App Engine
This is Rietveld 408576698