From 063c906f1f0550aeff9e39a135b5bdb5dcbd0d42 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 13 May 2024 01:22:18 +0200 Subject: [PATCH] avcodec/proresenc_anatoliy: Assert that AV_PROFILE_UNKNOWN is replaced If its not replaced we would have a negative index used in an array potentially Helps: CID1440385 Negative array index read Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer (cherry picked from commit 6106177ad66ab28f44520534f386239d2405eeab) Signed-off-by: Michael Niedermayer --- libavcodec/proresenc_anatoliy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index 02ab07d28e..b1a173e953 100644 --- a/libavcodec/proresenc_anatoliy.c +++ b/libavcodec/proresenc_anatoliy.c @@ -856,7 +856,8 @@ static av_cold int prores_encode_init(AVCodecContext *avctx) avctx->profile = AV_PROFILE_PRORES_4444; av_log(avctx, AV_LOG_INFO, "encoding with ProRes 4444+ (ap4h) profile\n"); - } + } else + av_assert0(0); } else if (avctx->profile < AV_PROFILE_PRORES_PROXY || avctx->profile > AV_PROFILE_PRORES_XQ) { av_log(