[FFmpeg-cvslog] avcodec/midivid: only multiple of 4 width/height are possible

Paul B Mahol git at videolan.org
Thu Feb 13 13:17:43 EET 2020


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Feb 13 12:15:42 2020 +0100| [e007059d6617ca966380810fe03c571566ecd9c3] | committer: Paul B Mahol

avcodec/midivid: only multiple of 4 width/height are possible

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e007059d6617ca966380810fe03c571566ecd9c3
---

 libavcodec/midivid.c | 3 +++
 1 file changed, 3 insertions(+)

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);



More information about the ffmpeg-cvslog mailing list