• Nathan Otterness's avatar
    image/png: integer underflow when decoding · 66c25fa9
    Nathan Otterness authored
    This change addresses an integer underflow appearing only on systems
    using a 32-bit int type. The patch addresses the problem by limiting the
    length of unknown chunks to 0x7fffffff. This value appears to already be
    checked for when parsing other chunk types, so the bug shouldn't appear
    elsewhere in the package. The PNG spec recommends the maximum size for
    any chunk to remain under 2^31, so this shouldn't cause errors with
    valid images.
    
    Fixes #12687
    
    Change-Id: I17f0e1683515532c661cf2b0b2bc65309d1b7bb7
    Reviewed-on: https://go-review.googlesource.com/14766Reviewed-by: 's avatarNigel Tao <nigeltao@golang.org>
    66c25fa9
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...