From: Kostya Shishkov Date: Fri, 23 Dec 2022 07:39:09 +0000 (+0100) Subject: mov: sanitise position on seek error X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=a970b2110488aeff5855743d1728ee83462e8306;hp=534a5b60b896020c2113a29436333e4b1ec83334;p=nihav.git mov: sanitise position on seek error --- diff --git a/nihav-commonfmt/src/demuxers/mov.rs b/nihav-commonfmt/src/demuxers/mov.rs index 9cf82a9..f4cd393 100644 --- a/nihav-commonfmt/src/demuxers/mov.rs +++ b/nihav-commonfmt/src/demuxers/mov.rs @@ -1516,6 +1516,9 @@ impl Track { csamp += cur_samps; if csamp > self.cur_sample { if self.cur_chunk >= self.chunk_offsets.len() { + self.cur_sample = csamp - cur_samps; + self.samples_left = 0; + self.cur_sample = csamp; return Err(DemuxerError::SeekError); } self.last_offset = self.chunk_offsets[self.cur_chunk];