diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2022-10-13 18:21:33 +0200 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2022-10-13 18:22:10 +0200 |
commit | 51772ce8af03dfc649c6f66aed3b3952d3b6652f (patch) | |
tree | 5bc59267cf78dab3f2b9d4f76b33927a875e6fd8 | |
parent | f7686373872ed8a9378dbde734d6f6220ed64aef (diff) | |
download | nihav-51772ce8af03dfc649c6f66aed3b3952d3b6652f.tar.gz |
indeo5: fix band size check
-rw-r--r-- | nihav-indeo/src/codecs/indeo5.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nihav-indeo/src/codecs/indeo5.rs b/nihav-indeo/src/codecs/indeo5.rs index ec23981..0c6d65e 100644 --- a/nihav-indeo/src/codecs/indeo5.rs +++ b/nihav-indeo/src/codecs/indeo5.rs @@ -180,10 +180,11 @@ impl IndeoXParser for Indeo5Parser { let data_size: usize; if (band_flags & 0x80) != 0 { data_size = br.read(24)? as usize; + validate!(data_size >= 4); } else { data_size = 0; } - validate!(data_size <= ((br.left() / 8) as usize)); + validate!(data_size <= ((br.left() / 8) as usize) + 4); let num_corr: usize; let mut corr_map: [u8; CORR_MAP_SIZE] = [0; CORR_MAP_SIZE]; |