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:
2023-05-21 15:14:38 +02:00
parent 93ee6dfea5
commit 8ad4bc425c

View File

@ -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))