summaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2019-10-25 12:16:29 +0200
committerPaul B Mahol <onemda@gmail.com>2019-10-25 12:22:25 +0200
commit9d711a90fdf379dca2b3d24893c820c3060b5d94 (patch)
treeffdc6f6022c7533d7d65b8b7a2faef24e3b20ed8 /libavformat
parent155508c6e925f4f2f5e77087a7e1925b3de735ff (diff)
downloadffmpeg-streaming-9d711a90fdf379dca2b3d24893c820c3060b5d94.zip
ffmpeg-streaming-9d711a90fdf379dca2b3d24893c820c3060b5d94.tar.gz
avformat/bintext: avoid division by zero
Fixes #8335
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/bintext.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/bintext.c b/libavformat/bintext.c
index d492174..61b89f5 100644
--- a/libavformat/bintext.c
+++ b/libavformat/bintext.c
@@ -149,7 +149,7 @@ static int bin_probe(const AVProbeData *p)
return AVPROBE_SCORE_EXTENSION + 1;
predict_width(&par, p->buf_size, got_width);
- if (par.width <= 0)
+ if (par.width < 8)
return 0;
calculate_height(&par, p->buf_size);
if (par.height <= 0)
@@ -195,6 +195,8 @@ static int bintext_read_header(AVFormatContext *s)
next_tag_read(s, &bin->fsize);
if (!bin->width) {
predict_width(st->codecpar, bin->fsize, got_width);
+ if (st->codecpar->width < 8)
+ return AVERROR_INVALIDDATA;
calculate_height(st->codecpar, bin->fsize);
}
avio_seek(pb, 0, SEEK_SET);
OpenPOWER on IntegriCloud