Commit 20ecb7c5bf for ffmpeg

commit 20ecb7c5bf8e00165e8248580325802a4a7a7466
Author: Alhuda Khan <alhuda@research.digiscrypt.com>
Date:   Mon Nov 30 09:27:47 2026 +0000

    avcodec/vqcdec: check height alignment and positive dimensions

    decode_frame() processes macroblocks in strips of 4 rows (height / 4), leaving
    bottom scanlines uninitialized if avctx->height is not a multiple of 4. Reject
    non-positive dimensions and heights not divisible by 4 during initialization.

    Signed-off-by: Alhuda Khan <alhuda@research.digiscrypt.com>
    Signed-off-by: Peter Ross <pross@xvid.org>

diff --git a/libavcodec/vqcdec.c b/libavcodec/vqcdec.c
index bb69844327..b3b59665de 100644
--- a/libavcodec/vqcdec.c
+++ b/libavcodec/vqcdec.c
@@ -73,7 +73,9 @@ static av_cold int vqc_decode_init(AVCodecContext * avctx)
     static AVOnce init_static_once = AV_ONCE_INIT;
     VqcContext *s = avctx->priv_data;

-    if (avctx->width & 15)
+    if (avctx->width <= 0 || avctx->height <= 0)
+        return AVERROR(EINVAL);
+    if ((avctx->width & 15) || (avctx->height & 3))
         return AVERROR_PATCHWELCOME;

     s->vectors = av_malloc((avctx->width * avctx->height * 3) / 2);