aboutsummaryrefslogtreecommitdiff
path: root/src/image/png/reader.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/image/png/reader.go')
-rw-r--r--src/image/png/reader.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/image/png/reader.go b/src/image/png/reader.go
index 32f78f0ffe..8299df5673 100644
--- a/src/image/png/reader.go
+++ b/src/image/png/reader.go
@@ -612,6 +612,11 @@ func (d *decoder) readImagePass(r io.Reader, pass int, allocateOnly bool) (image
}
}
case cbG8:
+ if d.useTransparent {
+ // Match error from Go 1.7 and earlier.
+ // Go 1.9 will decode this properly.
+ return nil, chunkOrderError
+ }
copy(gray.Pix[pixOffset:], cdat)
pixOffset += gray.Stride
case cbGA8: