diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2022-07-03 14:05:13 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-07-12 21:55:22 +0200 |
commit | ba0c3d1db420dfaeaec44a8bbd40ec5593dccb04 (patch) | |
tree | ba64a45cf2b811004ce3b079764af280e1dd0726 /libavformat | |
parent | b4431399ec1e10afff458cf1ffae2a75987d725a (diff) | |
download | ffmpeg-ba0c3d1db420dfaeaec44a8bbd40ec5593dccb04.tar.gz |
avformat/avienc: Check video dimensions
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/avienc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/avienc.c b/libavformat/avienc.c index 2264241d57..14115b3e2b 100644 --- a/libavformat/avienc.c +++ b/libavformat/avienc.c @@ -426,6 +426,10 @@ static int avi_write_header(AVFormatContext *s) avio_wl32(pb, -1); /* quality */ avio_wl32(pb, au_ssize); /* sample size */ avio_wl32(pb, 0); + if (par->width > 65535 || par->height > 65535) { + av_log(s, AV_LOG_ERROR, "%dx%d dimensions are too big\n", par->width, par->height); + return AVERROR(EINVAL); + } avio_wl16(pb, par->width); avio_wl16(pb, par->height); ff_end_tag(pb, strh); |