diff --git a/libavformat/bintext.c b/libavformat/bintext.c index 31ab70e54c..c936b11c52 100644 --- a/libavformat/bintext.c +++ b/libavformat/bintext.c @@ -242,6 +242,8 @@ static int adf_read_header(AVFormatContext *s) bin->fsize = avio_size(pb) - 1 - 192 - 4096; st->codecpar->width = 80<<3; 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, 1 + 192 + 4096, SEEK_SET);