]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/yuv4mpegdec.c
avformat/hlsenc: fix default AES key file url with variant streams
[ffmpeg] / libavformat / yuv4mpegdec.c
index 855fadbb31a3f9a25b58c5c85fbd848389f4ad80..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)
@@ -333,7 +335,7 @@ static int yuv4_read_seek(AVFormatContext *s, int stream_index,
     return 0;
 }
 
-static int yuv4_probe(AVProbeData *pd)
+static int yuv4_probe(const AVProbeData *pd)
 {
     /* check file header */
     if (strncmp(pd->buf, Y4M_MAGIC, sizeof(Y4M_MAGIC) - 1) == 0)