diff options
author | Paul B Mahol <onemda@gmail.com> | 2020-02-13 12:15:42 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2020-02-13 12:15:42 +0100 |
commit | e007059d6617ca966380810fe03c571566ecd9c3 (patch) | |
tree | b2d485b736c816be7be4ccdd38502e10187dd803 /libavcodec/midivid.c | |
parent | 388a221a8ba6f550e8c3a2f8a10e6162d1ce6616 (diff) |
avcodec/midivid: only multiple of 4 width/height are possible
Diffstat (limited to 'libavcodec/midivid.c')
-rw-r--r-- | libavcodec/midivid.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/midivid.c b/libavcodec/midivid.c index afa394fca5..2200440e2c 100644 --- a/libavcodec/midivid.c +++ b/libavcodec/midivid.c @@ -238,6 +238,9 @@ static av_cold int decode_init(AVCodecContext *avctx) MidiVidContext *s = avctx->priv_data; int ret = av_image_check_size(avctx->width, avctx->height, 0, avctx); + if (avctx->width & 3 || avctx->height & 3) + ret = AVERROR_INVALIDDATA; + if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Invalid image size %dx%d.\n", avctx->width, avctx->height); |