X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-commonfmt%2Fsrc%2Fdemuxers%2Favi.rs;h=1b59aac22f541388c3cc636ddbf7e38939a420f6;hb=77d52ff687dc8ebb0a565b3be4777a3adba3b953;hp=cf1b5bfa5fb1b7ebf4f5aa1c80e53faac5244839;hpb=787b8d03074419d7f8e6b52daba02a3807444bc2;p=nihav.git diff --git a/nihav-commonfmt/src/demuxers/avi.rs b/nihav-commonfmt/src/demuxers/avi.rs index cf1b5bf..1b59aac 100644 --- a/nihav-commonfmt/src/demuxers/avi.rs +++ b/nihav-commonfmt/src/demuxers/avi.rs @@ -415,7 +415,8 @@ fn parse_strf_vids(dmx: &mut AVIDemuxer, strmgr: &mut StreamManager, size: usize let flip = height < 0; let format = if bitcount > 8 { RGB24_FORMAT } else { PAL8_FORMAT }; - let vhdr = NAVideoInfo::new(width as usize, if flip { -height as usize } else { height as usize}, flip, format); + let mut vhdr = NAVideoInfo::new(width as usize, if flip { -height as usize } else { height as usize}, flip, format); + vhdr.bits = (planes as u8) * (bitcount as u8); let vci = NACodecTypeInfo::Video(vhdr); let edata = dmx.read_extradata(size - 40)?; if colors > 0 { @@ -533,7 +534,8 @@ fn parse_idx1(src: &mut ByteReader, strmgr: &mut StreamManager, seek_idx: &mut S let (tb_num, tb_den) = str.get_timebase(); let pts = counter[stream_no]; let time = NATimeInfo::ts_to_time(pts, 1000, tb_num, tb_den); - seek_idx.add_entry(stream_no as u32, SeekEntry { time, pts, pos: offset + movi_pos - 4 }); + validate!(offset >= movi_pos); + seek_idx.add_entry(stream_no as u32, SeekEntry { time, pts, pos: offset }); } key_offs.push(offset); }