]> Cypherpunks repositories - gostls13.git/commit
image/png: ignore trailing IDAT chunks
authorTilman Dilo <tilman.dilo@gmail.com>
Wed, 23 Mar 2016 21:38:52 +0000 (22:38 +0100)
committerNigel Tao <nigeltao@golang.org>
Thu, 24 Mar 2016 10:57:01 +0000 (10:57 +0000)
commit633e41432c7c617809ddb22c0c3f2fc214a26b99
treef045f5879ddffe95f339faa9968fea3c779ece47
parentebd67ba588eabd5bf968b5bd14dff21a1a1b1be4
image/png: ignore trailing IDAT chunks

Ignore superfluous trailing IDAT chunks which were not consumed when decoding
the image. This change fixes decoding of valid images in which a zero-length
IDAT chunk appears after the actual image data. It also prevents decoding of
trailing garbage IDAT chunks or maliciously embedded additional images.

Fixes #14936

Change-Id: I8c76cfa9a03496d9576f72bed2db109271f97c5e
Reviewed-on: https://go-review.googlesource.com/21045
Reviewed-by: Nigel Tao <nigeltao@golang.org>
src/image/png/reader.go
src/image/png/reader_test.go