std/lzma: track prior decoded length

This commit is contained in:
Nigel Tao committed 2023-12-26 23:48:47 +11:00
1 parent 5a7299b5c2
commit 2afec50f62
4 files changed
+22 -10

No files matched your search

+1 -1
View File
@@ -805,7 +805,7 @@ pri func decoder.decode_bitstream_slow?(dst: base.io_writer, src: base.io_reader
// AlgOve90 labelDoTheLZCopy:
// AlgOve94 emitCopy(len, mrud[0])
assert len >= 1
if (((rep0 + 1) as base.u64) > pos) or
if (((rep0 + 1) as base.u64) > (pos ~mod+ this.lzma2_prior_decoded_length)) or
(((rep0 + 1) as base.u64) > (this.dict_size as base.u64)) {
return "#bad distance"
}