Make sure we're not reading 0 bits in the lzw decompression loop -- this causes a hang
parent
c6b37f4da4
commit
fa042f6578
|
@ -26,9 +26,11 @@ TUPLE: gif-lzw < lzw ;
|
|||
dup end-of-information-code>> 1 + initial-uncompress-table >>table
|
||||
dup initial-code-size>> >>code-size ;
|
||||
|
||||
ERROR: code-size-zero ;
|
||||
|
||||
: <lzw-uncompress> ( input code-size class -- obj )
|
||||
new
|
||||
swap >>code-size
|
||||
swap [ code-size-zero ] when-zero >>code-size
|
||||
dup code-size>> >>initial-code-size
|
||||
dup code-size>> 1 - 2^ >>clear-code
|
||||
dup clear-code>> 1 + >>end-of-information-code
|
||||
|
|
Loading…
Reference in New Issue