aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/image/jpeg/huffman.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/image/jpeg/huffman.go')
-rw-r--r--libgo/go/image/jpeg/huffman.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/libgo/go/image/jpeg/huffman.go b/libgo/go/image/jpeg/huffman.go
index 4f8fe8eff32..95aaf71e2f3 100644
--- a/libgo/go/image/jpeg/huffman.go
+++ b/libgo/go/image/jpeg/huffman.go
@@ -101,7 +101,8 @@ func (d *decoder) processDHT(n int) error {
return FormatError("bad Tc value")
}
th := d.tmp[0] & 0x0f
- if th > maxTh || !d.progressive && th > 1 {
+ // The baseline th <= 1 restriction is specified in table B.5.
+ if th > maxTh || (d.baseline && th > 1) {
return FormatError("bad Th value")
}
h := &d.huff[tc][th]