mirror of
https://github.com/golang/go
synced 2024-11-02 13:21:55 +00:00
image/jpeg: when following component selectors, only consider valid
components. This fixes decoding JPEG images where the component selector is 0. Such images are rare, but not impossible. Change-Id: I6d221bce01cce8cc0440e117543233371782ca22 Reviewed-on: https://go-review.googlesource.com/6421 Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
parent
40ff393e4c
commit
0fe6b1293a
1 changed files with 1 additions and 1 deletions
|
@ -66,7 +66,7 @@ func (d *decoder) processSOS(n int) error {
|
|||
for i := 0; i < nComp; i++ {
|
||||
cs := d.tmp[1+2*i] // Component selector.
|
||||
compIndex := -1
|
||||
for j, comp := range d.comp {
|
||||
for j, comp := range d.comp[:d.nComp] {
|
||||
if cs == comp.c {
|
||||
compIndex = j
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue