diff options
author | Paul B Mahol <onemda@gmail.com> | 2019-09-22 19:24:17 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2019-09-22 19:25:55 +0200 |
commit | 05a2ce93265442285b2838530ba5bb5702cd18b1 (patch) | |
tree | 1e1f2da3549f2460ea0bb8110d3bf466d6c1fd02 | |
parent | 0728d644973c314785c26b3d0559ba829ca31641 (diff) | |
download | ffmpeg-05a2ce93265442285b2838530ba5bb5702cd18b1.tar.gz |
avformat/y4m: do not try to seek if pts is less than 0
Fixes #8193.
-rw-r--r-- | libavformat/yuv4mpegdec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/yuv4mpegdec.c b/libavformat/yuv4mpegdec.c index fc2f0ca054..eceb945bb1 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) |