Commit 48936e46 authored by Nigel Tao's avatar Nigel Tao

image/gif: close the lzw.Reader we create.

The lzw.NewReader doc comment says, "It is the caller's responsibility
to call Close on the ReadCloser when finished reading."

Thanks to Andrew Bonventre for noticing this.

R=r, dsymonds, adg
CC=andybons, golang-dev
https://golang.org/cl/10821043
parent 1856286f
......@@ -190,6 +190,7 @@ func (d *decoder) decode(r io.Reader, configOnly bool) error {
// A wonderfully Go-like piece of magic.
br := &blockReader{r: d.r}
lzwr := lzw.NewReader(br, lzw.LSB, int(litWidth))
defer lzwr.Close()
if _, err = io.ReadFull(lzwr, m.Pix); err != nil {
if err != io.ErrUnexpectedEOF {
return err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment