git.lucas.co / go_mono
git clone https://git.lucas.co/go_mono.git

commit92cae9f9bc8e839ff69ff99d3633f49bac6c9f8e
parenteb11b45157
authorNigel Tao <[email protected]>
date2015-07-02 11:14
tiff/lzw: sync (yet again) to the upstream lzw in the stdlib.

This picks up a recent change:
https://go-review.googlesource.com/#/c/11661/

Change-Id: I0309f7b804e0d88ea623c8ae97b65cd0c2bad101
Reviewed-on: https://go-review.googlesource.com/11850
Reviewed-by: David Symonds <[email protected]>

 tiff/lzw/reader.go | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tiff/lzw/reader.go b/tiff/lzw/reader.go
index 033732c..ad35819 100644
--- a/tiff/lzw/reader.go
+++ b/tiff/lzw/reader.go
@@ -154,6 +154,7 @@ func (d *decoder) decode() {
 				err = io.ErrUnexpectedEOF
 			}
 			d.err = err
+			d.flush()
 			return
 		}
 		switch {
@@ -205,6 +206,7 @@ func (d *decoder) decode() {
 			}
 		default:
 			d.err = errors.New("lzw: invalid code")
+			d.flush()
 			return
 		}
 		d.last, d.hi = code, d.hi+1