]> Cypherpunks repositories - gostls13.git/commit
image/gif: handle an extra data sub-block byte.
authorWill Storey <will@summercat.com>
Mon, 20 Feb 2017 05:24:17 +0000 (21:24 -0800)
committerNigel Tao <nigeltao@golang.org>
Thu, 2 Mar 2017 23:49:32 +0000 (23:49 +0000)
commit4775b7feb10014751da2669da973fb852f09aebe
tree362ef135859aa32d04444cded3ed4342cf3a3fb7
parent9b15c13dc567d92c6ac628c762d42b4ae2c9469f
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>
src/image/gif/reader.go
src/image/gif/reader_test.go