From f638a5b1b3241b3433689983aca22d9e6518a64f Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Tue, 14 Feb 2023 18:50:51 +0100 Subject: [PATCH] avi: fix handling of palette change chunk with 256 colours --- nihav-commonfmt/src/demuxers/avi.rs | 1 + 1 file changed, 1 insertion(+) 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); -- 2.39.5