From bfe6df949f555fd6a316a51fa2e07d8ac4339c6e Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Tue, 14 Mar 2023 11:32:11 +0100 Subject: [PATCH] avimux: fix palette writing in the video stream header --- nihav-commonfmt/src/muxers/avi.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nihav-commonfmt/src/muxers/avi.rs b/nihav-commonfmt/src/muxers/avi.rs index fad358c..02283e4 100644 --- a/nihav-commonfmt/src/muxers/avi.rs +++ b/nihav-commonfmt/src/muxers/avi.rs @@ -256,7 +256,12 @@ impl<'a> MuxCore<'a> for AVIMuxer<'a> { if let NASideData::Palette(_, ref pal) = sdata { let cur_pos = self.bw.tell(); self.bw.seek(SeekFrom::Start(u64::from(self.pal_pos[str_num])))?; - self.bw.write_buf(pal.as_ref())?; + for quad in pal.chunks(4) { + self.bw.write_byte(quad[2])?; + self.bw.write_byte(quad[1])?; + self.bw.write_byte(quad[0])?; + self.bw.write_byte(0)?; + } self.bw.seek(SeekFrom::Start(cur_pos))?; self.pal_pos[str_num] = 0; break; -- 2.39.5