aboutsummaryrefslogtreecommitdiffstats
path: root/nihav-commonfmt
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2023-02-14 18:50:51 +0100
committerKostya Shishkov <kostya.shishkov@gmail.com>2023-02-14 18:50:51 +0100
commitf638a5b1b3241b3433689983aca22d9e6518a64f (patch)
treeca109081b0d7af1242753174bf2ca2717dbc2ec1 /nihav-commonfmt
parent2bf1f2332263f37d3cffa4bdee50f58d29bec680 (diff)
downloadnihav-f638a5b1b3241b3433689983aca22d9e6518a64f.tar.gz
avi: fix handling of palette change chunk with 256 colours
Diffstat (limited to 'nihav-commonfmt')
-rw-r--r--nihav-commonfmt/src/demuxers/avi.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/nihav-commonfmt/src/demuxers/avi.rs b/nihav-commonfmt/src/demuxers/avi.rs
index 0ab7711..f14c31a 100644
--- a/nihav-commonfmt/src/demuxers/avi.rs
+++ b/nihav-commonfmt/src/demuxers/avi.rs
@@ -429,6 +429,7 @@ impl<'a> AVIDemuxer<'a> {
if pe.stream_no == stream_no {
let start_clr = self.src.read_byte()? as usize;
let len = self.src.read_byte()? as usize;
+ let len = if len == 0 { 256 } else { len };
let _flags = self.src.read_u16le()?;
validate!(start_clr + len <= 256);
validate!(len * 4 + 4 == size);