diff options
author | 2013-12-19 20:57:45 +0000 | |
---|---|---|
committer | 2013-12-19 20:57:45 +0000 | |
commit | 3a8ebd9e71dab5c6640c40b8576dbe0d901c261b (patch) | |
tree | 3573ed398197cd9992a1bfd472566bf3d5a044b9 /Makefile.old | |
parent | cc36aab8ff8adbabd51f5b7722f1464158aedd33 (diff) |
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
Review URL: https://codereview.chromium.org/103343006
git-svn-id: http://skia.googlecode.com/svn/trunk@12786 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'Makefile.old')
0 files changed, 0 insertions, 0 deletions