• Will Storey's avatar
    image/gif: handle an extra data sub-block byte. · 4775b7fe
    Will Storey authored
    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/37258Reviewed-by: 's avatarNigel Tao <nigeltao@golang.org>
    Run-TryBot: Nigel Tao <nigeltao@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    4775b7fe
Name
Last commit
Last update
..
color Loading commit data...
draw Loading commit data...
gif Loading commit data...
internal/imageutil Loading commit data...
jpeg Loading commit data...
png Loading commit data...
testdata Loading commit data...
decode_example_test.go Loading commit data...
decode_test.go Loading commit data...
format.go Loading commit data...
geom.go Loading commit data...
geom_test.go Loading commit data...
image.go Loading commit data...
image_test.go Loading commit data...
names.go Loading commit data...
ycbcr.go Loading commit data...
ycbcr_test.go Loading commit data...