mirror of
https://github.com/ziglang/zig.git
synced 2026-01-05 21:13:24 +00:00
std.compress.zstandard: validate fse table value count
This commit is contained in:
parent
95953e1ee6
commit
31d1cae8c6
@ -1418,8 +1418,7 @@ fn decodeFseTable(
|
||||
}
|
||||
bit_reader.alignToByte();
|
||||
|
||||
// TODO: check there are at least 2 non-zero probabilities
|
||||
|
||||
if (value_count < 2) return error.MalformedFseTable;
|
||||
if (accumulated_probability != total_probability) return error.MalformedFseTable;
|
||||
if (value_count > expected_symbol_count) return error.MalformedFseTable;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user