Skip to content

Commit

Permalink
image/jpeg: reject multiple Start-Of-Frame markers.
Browse files Browse the repository at this point in the history
Fixes golang#10389

Change-Id: Id1c687122751f9317041d9e425d03b267a26c6de
Reviewed-on: https://go-review.googlesource.com/8681
Reviewed-by: Rob Pike <[email protected]>
  • Loading branch information
nigeltao committed Apr 9, 2015
1 parent c844bf4 commit eb44082
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/image/jpeg/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ func (d *decoder) ignore(n int) error {

// Specified in section B.2.2.
func (d *decoder) processSOF(n int) error {
if d.nComp != 0 {
return FormatError("multiple SOF markers")
}
switch n {
case 6 + 3*1: // Grayscale image.
d.nComp = 1
Expand Down

0 comments on commit eb44082

Please sign in to comment.