diff options
Diffstat (limited to 'libgo/go/image/jpeg/scan.go')
-rw-r--r-- | libgo/go/image/jpeg/scan.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libgo/go/image/jpeg/scan.go b/libgo/go/image/jpeg/scan.go index e3ae8ae441c..a69ed17489c 100644 --- a/libgo/go/image/jpeg/scan.go +++ b/libgo/go/image/jpeg/scan.go @@ -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) } } |