]> Cypherpunks repositories - gostls13.git/commit
image/png: reject zero-width and zero-height images.
authorNigel Tao <nigeltao@golang.org>
Wed, 9 Sep 2015 00:57:40 +0000 (10:57 +1000)
committerNigel Tao <nigeltao@golang.org>
Wed, 9 Sep 2015 02:53:58 +0000 (02:53 +0000)
commit0cf7331391ba9ceb7ae755ca9172ba90f6ac516b
tree820acacfca3bae08f16e1b8c958dd615d1dee6d5
parente5d9cafbe8aa071eb76020ae77a1ae090eac2a7e
image/png: reject zero-width and zero-height images.

http://www.w3.org/TR/PNG/#11IHDR says that "Zero is an invalid value".

This change only affects the decoder. The encoder already checks
non-positive instead of negative.

Fixes #12545.

Change-Id: Iba40e1a2f4e0eec8b2fbcd3bbdae886311434da7
Reviewed-on: https://go-review.googlesource.com/14411
Reviewed-by: Rob Pike <r@golang.org>
src/image/png/reader.go