[FFmpeg-cvslog] avcodec/libxvid: add check for invalid intra/inter matrix values

Marton Balint git at videolan.org
Sat Feb 1 22:18:32 EET 2025


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Sat Jan 25 20:25:38 2025 +0100| [9b5a4c0aea1f8ac2082c223d8b6a5e5d8a896dbd] | committer: Marton Balint

avcodec/libxvid: add check for invalid intra/inter matrix values

Signed-off-by: Marton Balint <cus at passwd.hu>

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

 libavcodec/libxvid.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c
index fbd33b7065..850e691403 100644
--- a/libavcodec/libxvid.c
+++ b/libavcodec/libxvid.c
@@ -617,6 +617,10 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
     x->intra_matrix =
     x->inter_matrix = NULL;
 
+    ret = ff_check_codec_matrices(avctx, FF_MATRIX_TYPE_INTRA | FF_MATRIX_TYPE_INTER, 1, 255);
+    if (ret < 0)
+        return ret;
+
     if (x->mpeg_quant)
         x->vol_flags |= XVID_VOL_MPEGQUANT;
     if ((avctx->intra_matrix || avctx->inter_matrix)) {



More information about the ffmpeg-cvslog mailing list