Skip to content

Commit

Permalink
image/jpeg: for progressive JPEGs, the first SOS segment doesn't
Browse files Browse the repository at this point in the history
necessarily contain all components.

Fixes #4975.

R=r, minux.ma, bradfitz
CC=golang-dev
https://golang.org/cl/7469043
  • Loading branch information
nigeltao committed Mar 5, 2013
1 parent a22361d commit 0d9bf27
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/pkg/image/jpeg/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@ func (d *decoder) processSOS(n int) error {
myy := (d.height + 8*v0 - 1) / (8 * v0)
if d.img1 == nil && d.img3 == nil {
d.makeImg(h0, v0, mxx, myy)
if d.progressive {
for i := 0; i < nComp; i++ {
compIndex := scan[i].compIndex
}
if d.progressive {
for i := 0; i < nComp; i++ {
compIndex := scan[i].compIndex
if d.progCoeffs[compIndex] == nil {
d.progCoeffs[compIndex] = make([]block, mxx*myy*d.comp[compIndex].h*d.comp[compIndex].v)
}
}
Expand Down

0 comments on commit 0d9bf27

Please sign in to comment.