From: Kostya Shishkov Date: Tue, 14 Mar 2023 10:32:11 +0000 (+0100) Subject: avimux: fix palette writing in the video stream header X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=bfe6df949f555fd6a316a51fa2e07d8ac4339c6e;p=nihav.git avimux: fix palette writing in the video stream header --- 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;