[FFmpeg-cvslog] avformat/y4m: do not try to seek if pts is less than 0
Paul B Mahol
git at videolan.org
Sun Sep 22 20:32:13 EEST 2019
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Sep 22 19:24:17 2019 +0200| [05a2ce93265442285b2838530ba5bb5702cd18b1] | committer: Paul B Mahol
avformat/y4m: do not try to seek if pts is less than 0
Fixes #8193.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=05a2ce93265442285b2838530ba5bb5702cd18b1
---
libavformat/yuv4mpegdec.c | 2 ++
1 file changed, 2 insertions(+)
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)
More information about the ffmpeg-cvslog
mailing list