From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 7789B4A67F for ; Fri, 5 Jul 2024 00:23:11 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 181B968DB06; Fri, 5 Jul 2024 03:22:22 +0300 (EEST) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 423F368DAC1 for ; Fri, 5 Jul 2024 03:22:07 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 7A52BFF805 for ; Fri, 5 Jul 2024 00:22:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1720138926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RivaORMlTknVRy9SU+AeShy2ESFcTlDTA+/aTtt160A=; b=oBmX/HoIqFm5zGQCvVEzOaPKNyvFX4+ZiGqIj03TwPWT9tKJN+WWYTxs4B2DjJY87Mi/Bv ef9c5xanA9shRKIUxW6VGW3zdBdVwmPKLnIaXFIRKwUJCr1rKVEoeMtZ7PYv7oGG3I30FA mDv+iyLxsIPhogbto4wC65vrVK4vXtszTVcFuUA4LEOpLEwoDdQaKmG1VDBm+IezvSDwTH A4ZoRoe6itIMwpyzubL/dXP2tHDEiIv5xiIa4NAog2xmhAb6ybIVoo0wdHjaT70bGwuQSv 6deofU+mCm7uutLTbe8rnwZoByFeTsT2aN0aBtY3F6k0fDdGx4tjoPcms2OlYA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 5 Jul 2024 02:21:53 +0200 Message-ID: <20240705002156.1964272-12-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240705002156.1964272-1-michael@niedermayer.cc> References: <20240705002156.1964272-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 12/15] avcodec/me_cmp: Fix type check X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Fixes: CID1604375 Out-of-bounds read Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/me_cmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/me_cmp.c b/libavcodec/me_cmp.c index 592ee760840..f3e2f2482ef 100644 --- a/libavcodec/me_cmp.c +++ b/libavcodec/me_cmp.c @@ -517,7 +517,7 @@ av_cold int ff_set_cmp(const MECmpContext *c, me_cmp_func *cmp, int type, int mp cmp[i] = zero_cmp; return 0; } - if (type > FF_ARRAY_ELEMS(cmp_func_list) || + if (type >= FF_ARRAY_ELEMS(cmp_func_list) || !cmp_func_list[type].available || !mpvenc && cmp_func_list[type].mpv_only) { av_log(NULL, AV_LOG_ERROR, -- 2.45.2 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".