std/lzma: fix uncompressed prior decoded length

This commit is contained in:
Nigel Tao committed 2023-12-27 23:40:10 +11:00
1 parent 4dbea68208
commit 1e5cf45090
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -52469,10 +52469,10 @@ wuffs_lzma__decoder__do_transform_io(
while (true) {
v_n_copied = wuffs_private_impl__io_writer__limited_copy_u32_from_reader(
&iop_a_dst, io2_a_dst,v_length, &iop_a_src, io2_a_src);
wuffs_private_impl__u64__sat_add_indirect(&self->private_impl.f_lzma2_prior_decoded_length, ((uint64_t)(v_n_copied)));
if (v_length <= v_n_copied) {
break;
}
wuffs_private_impl__u64__sat_add_indirect(&self->private_impl.f_lzma2_prior_decoded_length, ((uint64_t)(v_n_copied)));
v_length -= v_n_copied;
if (((uint64_t)(io2_a_dst - iop_a_dst)) == 0u) {
status = wuffs_base__make_status(wuffs_base__suspension__short_write);
+1 -1
View File
@@ -233,10 +233,10 @@ pri func decoder.do_transform_io?(dst: base.io_writer, src: base.io_reader) {
while true {
n_copied = args.dst.limited_copy_u32_from_reader!(up_to: length, r: args.src)
this.lzma2_prior_decoded_length ~sat+= n_copied as base.u64
if length <= n_copied {
break
}
this.lzma2_prior_decoded_length ~sat+= n_copied as base.u64
length -= n_copied
if args.dst.length() == 0 {
yield? base."$short write"
+1 -1
View File
@@ -54,7 +54,7 @@ OK. 15a2a343 test/3pdata/xzsuite/good-1-check-none.xz
OK. 15a2a343 test/3pdata/xzsuite/good-1-check-sha256.xz
OK. db4847fb test/3pdata/xzsuite/good-1-lzma2-1.xz
OK. db4847fb test/3pdata/xzsuite/good-1-lzma2-2.xz
BAD cb518f93 test/3pdata/xzsuite/good-1-lzma2-3.xz
OK. db4847fb test/3pdata/xzsuite/good-1-lzma2-3.xz
OK. db4847fb test/3pdata/xzsuite/good-1-lzma2-4.xz
OK. 00000000 test/3pdata/xzsuite/good-1-lzma2-5.xz
OK. 15a2a343 test/3pdata/xzsuite/good-2-lzma2.xz