From: Kostya Shishkov Date: Tue, 14 Feb 2023 17:50:51 +0000 (+0100) Subject: avi: fix handling of palette change chunk with 256 colours X-Git-Url: https://git.nihav.org/?p=nihav.git;a=commitdiff_plain;h=f638a5b1b3241b3433689983aca22d9e6518a64f avi: fix handling of palette change chunk with 256 colours --- 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);