mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 08:32:11 +01:00
Check 8-byte-chunk copy distance precondition
This commit is contained in:
1 parent
5767f030a3
commit
385c34930a
7 files changed
+22
-22
No files matched your search
@@ -341,7 +341,7 @@ pri func decoder.decode_huffman_fast32!(dst: base.io_writer, src: base.io_reader
|
||||
}
|
||||
}
|
||||
// Once again, redundant but explicit assertions.
|
||||
assert (dist_minus_1 + 1) > 0
|
||||
assert (dist_minus_1 + 1) >= 1
|
||||
assert ((dist_minus_1 + 1) as base.u64) <= args.dst.history_length()
|
||||
assert (length as base.u64) <= args.dst.length()
|
||||
assert ((length + 8) as base.u64) <= args.dst.length()
|
||||
|
||||
@@ -233,7 +233,7 @@ pri func decoder.decode_huffman_fast64!(dst: base.io_writer, src: base.io_reader
|
||||
}
|
||||
}
|
||||
// Once again, redundant but explicit assertions.
|
||||
assert (dist_minus_1 + 1) > 0
|
||||
assert (dist_minus_1 + 1) >= 1
|
||||
assert ((dist_minus_1 + 1) as base.u64) <= args.dst.history_length()
|
||||
assert (length as base.u64) <= args.dst.length()
|
||||
assert ((length + 8) as base.u64) <= args.dst.length()
|
||||
|
||||
Reference in new issue
Block a user