mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
std.compress.zstd: fix endianness issue
instead of manually bitcast, use the handy dandy takeStruct function.
This commit is contained in:
parent
ee4f5b3f92
commit
13e08ea6f0
1 changed files with 1 additions and 2 deletions
|
|
@ -151,8 +151,7 @@ fn readInFrame(d: *Decompress, w: *Writer, limit: Limit, state: *State.InFrame)
|
|||
const in = d.input;
|
||||
const window_len = d.window_len;
|
||||
|
||||
const header_bytes = try in.takeArray(3);
|
||||
const block_header: Frame.Zstandard.Block.Header = @bitCast(header_bytes.*);
|
||||
const block_header = try in.takeStruct(Frame.Zstandard.Block.Header, .little);
|
||||
const block_size = block_header.size;
|
||||
const frame_block_size_max = state.frame.block_size_max;
|
||||
if (frame_block_size_max < block_size) return error.BlockOversize;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue