summaryrefslogtreecommitdiff
path: root/libgo/go/image/png/reader.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/image/png/reader.go')
-rw-r--r--libgo/go/image/png/reader.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/libgo/go/image/png/reader.go b/libgo/go/image/png/reader.go
index ff837331f81..a6bf86ede65 100644
--- a/libgo/go/image/png/reader.go
+++ b/libgo/go/image/png/reader.go
@@ -652,10 +652,11 @@ func DecodeConfig(r io.Reader) (image.Config, error) {
}
return image.Config{}, err
}
- if d.stage == dsSeenIHDR && d.cb != cbP8 {
+ paletted := d.cb == cbP8 || d.cb == cbP4 || d.cb == cbP2 || d.cb == cbP1
+ if d.stage == dsSeenIHDR && !paletted {
break
}
- if d.stage == dsSeenPLTE && d.cb == cbP8 {
+ if d.stage == dsSeenPLTE && paletted {
break
}
}