summaryrefslogtreecommitdiff
path: root/libavformat/yuv4mpegdec.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2019-09-22 19:24:17 +0200
committerPaul B Mahol <onemda@gmail.com>2019-09-22 19:25:55 +0200
commit05a2ce93265442285b2838530ba5bb5702cd18b1 (patch)
tree1e1f2da3549f2460ea0bb8110d3bf466d6c1fd02 /libavformat/yuv4mpegdec.c
parent0728d644973c314785c26b3d0559ba829ca31641 (diff)
avformat/y4m: do not try to seek if pts is less than 0
Fixes #8193.
Diffstat (limited to 'libavformat/yuv4mpegdec.c')
-rw-r--r--libavformat/yuv4mpegdec.c2
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)