go/src/image
Will Storey 4775b7feb1 image/gif: handle an extra data sub-block byte.
This changes the decoder's behaviour when there is stray/extra data
found after an image is decompressed (e.g., data sub-blocks after an LZW
End of Information Code). Instead of raising an error, we silently skip
over such data until we find the end of the image data marked by a Block
Terminator. We skip at most one byte as sample problem GIFs exhibit this
property.

GIFs should not have and do not need such stray data (though the
specification is arguably ambiguous). However GIFs with such properties
have been seen in the wild.

Fixes #16146

Change-Id: Ie7e69052bab5256b4834992304e6ca58e93c1879
Reviewed-on: https://go-review.googlesource.com/37258
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Run-TryBot: Nigel Tao <nigeltao@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-03-02 23:49:32 +00:00
..
color image/color: tweak the YCbCr to RGBA conversion formula again. 2017-02-10 22:57:50 +00:00
draw image/draw: add FloydSteinberg Drawer example 2016-09-21 00:08:58 +00:00
gif image/gif: handle an extra data sub-block byte. 2017-03-02 23:49:32 +00:00
internal/imageutil image/color: tweak the YCbCr to RGBA conversion formula again. 2017-02-10 22:57:50 +00:00
jpeg image/jpeg: improve performance when encoding *image.YCbCr 2017-02-01 21:38:59 +00:00
png image/png: reduce memory allocs encoding images by reusing buffers 2017-02-12 05:40:47 +00:00
testdata
decode_example_test.go
decode_test.go
format.go
geom.go image: fix the overlap check in Rectangle.Intersect. 2017-02-10 05:05:59 +00:00
geom_test.go image: fix the overlap check in Rectangle.Intersect. 2017-02-10 05:05:59 +00:00
image.go
image_test.go
names.go
ycbcr.go
ycbcr_test.go