From a970b2110488aeff5855743d1728ee83462e8306 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Fri, 23 Dec 2022 08:39:09 +0100 Subject: [PATCH] mov: sanitise position on seek error --- nihav-commonfmt/src/demuxers/mov.rs | 3 +++ 1 file changed, 3 insertions(+) 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]; -- 2.39.5