mirror of
https://github.com/pmai/Deflate.git
synced 2025-12-21 21:14:29 +01:00
Error out on undefined distance codes 30/31
This regularizes our behavior vis-a-vis our handling of undefined length codes.
This commit is contained in:
@ -522,6 +522,10 @@ the corresponding decode-trees for literals/length and distance codes."
|
||||
"Decode the given distance symbol into a proper distance specification."
|
||||
(cond
|
||||
((<= symbol 3) (1+ symbol))
|
||||
((<= 30 symbol 31)
|
||||
(error 'deflate-decompression-error
|
||||
:format-control "Strange Distance Code in bitstream: ~D"
|
||||
:format-arguments (list symbol)))
|
||||
(t
|
||||
(multiple-value-bind (order offset) (truncate symbol 2)
|
||||
(declare (type (unsigned-byte 4) order offset))
|
||||
|
||||
Reference in New Issue
Block a user