diff mbox series

[FFmpeg-devel,v3,17/17] avformat/dvdvideodec: don't allow seeking beyond dvdnav reported duration

Message ID 20241007230505.27623-18-marth64@proxyid.net
State New
Headers show
Series avformat/dvdvideodec: bugfixes and menu chapter markers | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 fail Make failed

Commit Message

Marth64 Oct. 7, 2024, 11:05 p.m. UTC
There is no reason to accept timestamp values beyond what dvdnav
reported as the duration of the title.

Signed-off-by: Marth64 <marth64@proxyid.net>
---
 libavformat/dvdvideodec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c
index 06f842cc1c..b3ad2d63aa 100644
--- a/libavformat/dvdvideodec.c
+++ b/libavformat/dvdvideodec.c
@@ -1743,7 +1743,7 @@  static int dvdvideo_read_seek(AVFormatContext *s, int stream_index, int64_t time
     if ((flags & AVSEEK_FLAG_BYTE))
         return AVERROR(ENOSYS);
 
-    if (timestamp < 0)
+    if (timestamp < 0 || timestamp > s->duration)
         return AVERROR(EINVAL);
 
     if (!c->seek_warned) {