commit 95953e1ee6a50229e21423aa2ac4e6929b37468a (tree)
parent 6b85373875e2a7a8ef9d74e20e8e827dc622a29c
Author: dweiller <4678790+dweiller@users.noreplay.github.com>
Date: Tue, 24 Jan 2023 13:10:45 +1100
std.compress.zstandard: fix dictionary field size
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/std/compress/zstandard/decompress.zig b/lib/std/compress/zstandard/decompress.zig
@@ -898,8 +898,8 @@ pub fn decodeZStandardHeader(src: []const u8, consumed_count: ?*usize) !frame.ZS
var dictionary_id: ?u32 = null;
if (descriptor.dictionary_id_flag > 0) {
- // if flag is 3 we field_size = 4, else field_size = flag
- const field_size = (@as(u3, 1) << descriptor.dictionary_id_flag) >> 1;
+ // if flag is 3 then field_size = 4, else field_size = flag
+ const field_size = (@as(u4, 1) << descriptor.dictionary_id_flag) >> 1;
dictionary_id = readVarInt(u32, src[bytes_read_count .. bytes_read_count + field_size]);
bytes_read_count += field_size;
}