From f6390abad74f0cbff79fcb73efa7306d2c89e63e Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Mon, 25 Nov 2019 22:24:33 +0900 Subject: [PATCH] png: Update for Go 1.13 --- internal/png/stdlibreader.go | 2 +- internal/png/stdlibwriter.go | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/png/stdlibreader.go b/internal/png/stdlibreader.go index ca9878064..acaded255 100644 --- a/internal/png/stdlibreader.go +++ b/internal/png/stdlibreader.go @@ -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] diff --git a/internal/png/stdlibwriter.go b/internal/png/stdlibwriter.go index a34b85add..f573b96e5 100644 --- a/internal/png/stdlibwriter.go +++ b/internal/png/stdlibwriter.go @@ -290,7 +290,6 @@ func filter(cr *[nFilter][]byte, pr []byte, bpp int) int { } } if sum < best { - best = sum filter = ftAverage }