png: Update for Go 1.13

This commit is contained in:
Hajime Hoshi 2019-11-25 22:24:33 +09:00
parent f028610006
commit f6390abad7
2 changed files with 1 additions and 2 deletions

View File

@ -708,7 +708,7 @@ func (d *decoder) readImagePass(r io.Reader, pass int, allocateOnly bool) (image
}
}
case cbP8:
if len(paletted.Palette) != 255 {
if len(paletted.Palette) != 256 {
for x := 0; x < width; x++ {
if len(paletted.Palette) <= int(cdat[x]) {
paletted.Palette = paletted.Palette[:int(cdat[x])+1]

View File

@ -290,7 +290,6 @@ func filter(cr *[nFilter][]byte, pr []byte, bpp int) int {
}
}
if sum < best {
best = sum
filter = ftAverage
}