diff --git a/libavformat/bintext.c b/libavformat/bintext.c index 7dab5f377d..144b4172af 100644 --- a/libavformat/bintext.c +++ b/libavformat/bintext.c @@ -344,6 +344,8 @@ static int idf_read_header(AVFormatContext *s) bin->fsize = avio_size(pb) - 12 - 4096 - 48; ff_sauce_read(s, &bin->fsize, &got_width, 0); + if (st->codecpar->width < 8) + return AVERROR_INVALIDDATA; if (!bin->width) calculate_height(st->codecpar, bin->fsize); avio_seek(pb, 12, SEEK_SET);