]> Cypherpunks repositories - gostls13.git/commit
image/gif: fix writeImageBlock with SubImages
authorJed Denlea <jed@fastly.com>
Thu, 15 Jun 2017 22:53:09 +0000 (15:53 -0700)
committerNigel Tao <nigeltao@golang.org>
Fri, 16 Jun 2017 05:45:48 +0000 (05:45 +0000)
commitc52aca1c761f724c3192ee0ac4f4a19754fc5948
tree46396eba4346121bd0f1308d4b02c4fcb6c74675
parentbe9d7f6d874469fb66578537c05d180b4fab21d3
image/gif: fix writeImageBlock with SubImages

If an image has been cropped horizontally, writeImageBlock detects that
its width and Stride differ and acts accordingly.

However, if an image has been cropped vertically, trimming from the
bottom, the whole original image will be written in place.  This results
in more data in the LZW stream than necessary, and many decoders
including image/gif's itself will fail to load.

Fixes #20692

Change-Id: Id332877e31bcf3729c89d8a50c1be0464028d82e
Reviewed-on: https://go-review.googlesource.com/45972
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
Run-TryBot: Nigel Tao <nigeltao@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
src/image/gif/writer.go
src/image/gif/writer_test.go