Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image/jpeg panics when decoding progressive jpeg #5112

Closed
CSEMike opened this issue Mar 23, 2013 · 7 comments
Closed

image/jpeg panics when decoding progressive jpeg #5112

CSEMike opened this issue Mar 23, 2013 · 7 comments

Comments

@CSEMike
Copy link

CSEMike commented Mar 23, 2013

Go's jpeg image decoder panics when attempting to decode the attached image. 

This looks like a bug with progressive jpeg decoding added in 51f26e36ba98

I'm running go version devel +62bf913b4f40

go run converter.go
panic: runtime error: index out of range

goroutine 1 [running]:
image/jpeg.(*decoder).processSOS(0x4c20006a000, 0x6, 0x4c200073d28, 0x2)
    /usr/lib/google-golang/src/pkg/image/jpeg/scan.go:180 +0x19a3
image/jpeg.(*decoder).decode(0x4c20006a000, 0x4c200051390, 0x4c200068000, 0x407500,
0x49f708, ...)
    /usr/lib/google-golang/src/pkg/image/jpeg/reader.go:296 +0x6f2
image/jpeg.Decode(0x4c200051390, 0x4c200068000, 0x4c200068000, 0x4c200051390,
0x4c200068000, ...)
    /usr/lib/google-golang/src/pkg/image/jpeg/reader.go:320 +0x4b
image.Decode(0x4c200051300, 0x4c2000000a0, 0x540648, 0x4c200051300, 0x0, ...)
    /usr/lib/google-golang/src/pkg/image/format.go:84 +0x148
main.main()

Attachments:

  1. converter.go (318 bytes)
  2. image.jpg (1069 bytes)
@bradfitz
Copy link
Contributor

Comment 1:

Owner changed to @nigeltao.

@vdobler
Copy link
Contributor

vdobler commented Mar 25, 2013

Comment 2:

I cannot reproduce this issue on tip (16405:d448734315d3), the
image decodes without error and looks like the original.

@davecheney
Copy link
Contributor

Comment 3:

I am bisecting this now. I can confirm the test case does not pass @ 62bf913b4f40 but
does pass @ d448734315d3.

Owner changed to @davecheney.

Status changed to Started.

@davecheney
Copy link
Contributor

Comment 4:

I have confirmed that 91db139d15e5 fixed the bug. I will propose a CL to integrate this
small test image into the test suite.

@davecheney
Copy link
Contributor

Comment 5:

I have confirmed that 91db139d15e5 fixed the bug. I will propose a CL to integrate this
small test image into the test suite.

@davecheney
Copy link
Contributor

Comment 6:

https://golang.org/cl/7987045/

@davecheney
Copy link
Contributor

Comment 7:

Fixed by revision 91db139d15e5

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants