X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fyuv4mpegdec.c;h=eceb945bb112dec17dd429dee73f777f3ef82941;hb=8c3e9c9cbb725b6fdfe008ded702f3dd8025a58d;hp=855fadbb31a3f9a25b58c5c85fbd848389f4ad80;hpb=79025da3f2e7ab047c8f3c0c817952a98480b26b;p=ffmpeg diff --git a/libavformat/yuv4mpegdec.c b/libavformat/yuv4mpegdec.c index 855fadbb31a..eceb945bb11 100644 --- a/libavformat/yuv4mpegdec.c +++ b/libavformat/yuv4mpegdec.c @@ -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)