]> git.sesse.net Git - ffmpeg/commitdiff
avformat/y4m: do not try to seek if pts is less than 0
authorPaul B Mahol <onemda@gmail.com>
Sun, 22 Sep 2019 17:24:17 +0000 (19:24 +0200)
committerPaul B Mahol <onemda@gmail.com>
Sun, 22 Sep 2019 17:25:55 +0000 (19:25 +0200)
Fixes #8193.

libavformat/yuv4mpegdec.c

index fc2f0ca0543deaddb979beda9273b45132644f21..eceb945bb112dec17dd429dee73f777f3ef82941 100644 (file)
@@ -326,6 +326,8 @@ static int yuv4_read_seek(AVFormatContext *s, int stream_index,
 
     if (flags & AVSEEK_FLAG_BACKWARD)
         pts = FFMAX(0, pts - 1);
+    if (pts < 0)
+        return -1;
     pos = pts * s->packet_size;
 
     if (avio_seek(s->pb, pos + s->internal->data_offset, SEEK_SET) < 0)