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

Issue 103343006: Sanitize bitmaps produced by libgif (Closed)

Created:
7 years ago by hal.canary
Modified:
6 years, 11 months ago
Reviewers:
rmistry, robertphillips
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

Sanitize bitmaps produced by libgif Motivation: fix the bug linked to below. Some rare GIFs in the wild have a color table of size smaller than 256 and have one or more pixels with values that index out side of the colortable. Since it would be expensive to check the index every time we do a color lookup, we sanitize it at the source, in SkImageDecoder_libgif.cpp. The new function sanitize_indexed_bitmap checks each pixel to see if the index is outside of its allowed mask, and if so, sets that pixel to point at color 0. The bit mask optimization in this function relies on the fact that GIF requires the color table size to be a power of 2. To test: $ skia_images_gif_suppressDecoderWarnings=0 \ ..../render_pictures \ --bbh grid 256 256 --clone 1 --config 8888 --mode tile 256 256 \ -r ..../http___www_cafe24_com_.skp -w /tmp This should show verbose errors. BUG=skia:1946 R=robertphillips@google.com Committed: https://code.google.com/p/skia/source/detail?r=12786

Patch Set 1 #

Total comments: 2

Patch Set 2 : comments explaining function #

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

Messages

Total messages: 5 (0 generated)
hal.canary
PTAL
7 years ago (2013-12-19 20:16:41 UTC) #1
robertphillips
lgtm + comment request https://codereview.chromium.org/103343006/diff/1/src/images/SkImageDecoder_libgif.cpp File src/images/SkImageDecoder_libgif.cpp (right): https://codereview.chromium.org/103343006/diff/1/src/images/SkImageDecoder_libgif.cpp#newcode188 src/images/SkImageDecoder_libgif.cpp:188: static void sanitize_indexed_bitmap(SkBitmap* bm) { ...
7 years ago (2013-12-19 20:30:38 UTC) #2
hal.canary
https://codereview.chromium.org/103343006/diff/1/src/images/SkImageDecoder_libgif.cpp File src/images/SkImageDecoder_libgif.cpp (right): https://codereview.chromium.org/103343006/diff/1/src/images/SkImageDecoder_libgif.cpp#newcode188 src/images/SkImageDecoder_libgif.cpp:188: static void sanitize_indexed_bitmap(SkBitmap* bm) { On 2013/12/19 20:30:38, robertphillips ...
7 years ago (2013-12-19 20:50:11 UTC) #3
hal.canary
I also tested this twice with the new Cluster Telemetry Skia Tryserver, and found that ...
7 years ago (2013-12-19 20:57:05 UTC) #4
hal.canary
7 years ago (2013-12-19 20:57:50 UTC) #5
Message was sent while issue was closed.
Committed patchset #2 manually as r12786 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698