]> git.nihav.org Git - nihav.git/commitdiff
mov: sanitise position on seek error
authorKostya Shishkov <kostya.shishkov@gmail.com>
Fri, 23 Dec 2022 07:39:09 +0000 (08:39 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Fri, 23 Dec 2022 07:39:09 +0000 (08:39 +0100)
nihav-commonfmt/src/demuxers/mov.rs

index 9cf82a9382a1d49db7799057bcb426770f48312c..f4cd393477b06f6a2cdcc75c17565cd0fc423721 100644 (file)
@@ -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];