image/jpeg: "bad RST marker" error when decoding #40130
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
The following error occurred when I decoded a specific image.
Part of binary data of the image
The correct marker here should be [ ff d0 ], but there is some ff bytes in front of it.
It seems that there is a consecutive 0xFF bytes in the SOS segment that causes problems in marker's matching.
This is a quote from jpeg Wikipedia.
https://en.wikipedia.org/wiki/JPEG#Syntax_and_structure
So I think this situation should be taken into account at image/jpeg/scan.go
go/src/image/jpeg/scan.go
Line 332 in 4f2a2d7
What did you expect to see?
Image successfully decoded
What did you see instead?
invalid JPEG format: bad RST marker
The text was updated successfully, but these errors were encountered: