avformat/y4m: do not try to seek if pts is less than 0

Fixes #8193.
This commit is contained in:
Paul B Mahol 2019-09-22 19:24:17 +02:00
parent 0728d64497
commit 05a2ce9326
1 changed files with 2 additions and 0 deletions

View 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)