We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8cc57c0 commit 4e21555Copy full SHA for 4e21555
src/compress/lzw/reader.go
@@ -199,6 +199,9 @@ loop:
199
}
200
d.last, d.hi = code, d.hi+1
201
if d.hi >= d.overflow {
202
+ if d.hi > d.overflow {
203
+ panic("unreachable")
204
+ }
205
if d.width == maxWidth {
206
d.last = decoderInvalidCode
207
// Undo the d.hi++ a few lines above, so that (1) we maintain
@@ -207,7 +210,7 @@ loop:
210
d.hi--
208
211
} else {
209
212
d.width++
- d.overflow <<= 1
213
+ d.overflow = 1 << d.width
214
215
216
if d.o >= flushBuffer {
0 commit comments