Closed gopherbot closed 9 years ago
hg bisect shows that this was introduced by the change for decoding progressive jpegs: http://code.google.com/p/go/source/detail?r=51f26e36ba98
Ah, that particular image has a 2x2 sampling factor, which is common for color JPEG images (e.g. 2x2,1x1,1x1 corresponds to YCbCr 4:2:0), but is a weird thing to do for grayscale JPEG images. Still, I guess it's valid, and Go shouldn't choke on it. Re comment #1, you're right that it's a bug if the Go JPEG decoder ever panics on corrupt input, but FWIW, I'm glad it panicked when it did. If this code wasn't in a bounds-checked language (like C) then the decoder would happily have overwritten an unsafe memory region and we would never have noticed the bug as easily. Sorry for the late response, though. Re comment #6, the code change for progressive images changed the symptoms from error to panic, but the underlying bug existed beforehand in go1.0.3, as the OP noted. I've mailed out a fix at https://golang.org/cl/7069045
by samuel.stauffer:
Attachments: