mirror of
https://github.com/golang/go
synced 2024-09-15 22:20:06 +00:00
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
This commit is contained in:
parent
1856286fc2
commit
48936e46a1
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue