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 5EF704A0C8 for ; Wed, 20 Mar 2024 02:59:44 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1640E68D434; Wed, 20 Mar 2024 04:59:34 +0200 (EET) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E79B768D2FB for ; Wed, 20 Mar 2024 04:59:25 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id 27B1C1C0002 for ; Wed, 20 Mar 2024 02:59:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1710903565; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:in-reply-to:in-reply-to:references:references; bh=p5OsNMsEV3MbU2DCoba2cRxM7SHKuEph7AdAVfXaPpA=; b=GYM3KEC6bB+oFCygwzJHpGLe0O3hpOnJPf5j6dWmooQXy2Mlr+4o7s1j3Bk4pyOjvB+ObC 2t+GvVCox7SbrZghA+TnMPo271AVxn+NAb/2FP8wghJIvVyZ6NlV70Ih0YKcgP82pT5IRI aCcB5mPCoBxcMeVaJOLDpRb+bz8kjDpUZI3KuPY9OEwAUfMehe5skoPLwku2fFEG0kc/tG HbeAArRA558jfeT9P33xFNNzLnRxvV5+DkoGrl6A8AsIAdbWTKTrThEudUGX9gijc2z+Pg CajW5RX4MxqV+Cm7m3/L6aBrglYQ7+zB/Ka3bmCp8OJnfdmDx8OGunbicw5vZQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 20 Mar 2024 03:59:21 +0100 Message-Id: <20240320025923.3794-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240320025923.3794-1-michael@niedermayer.cc> References: <20240320025923.3794-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 2/4] avcodec/vmixdec: Check shift before use 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 MIME-Version: 1.0 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: shift exponent 32 is too large for 32-bit type 'unsigned int' Fixes: 65909/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VMIX_fuzzer-519459745831321 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/vmixdec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/vmixdec.c b/libavcodec/vmixdec.c index d6b6e3557f..ab283d13db 100644 --- a/libavcodec/vmixdec.c +++ b/libavcodec/vmixdec.c @@ -235,6 +235,9 @@ static int decode_frame(AVCodecContext *avctx, else if (offset != 3) return AVERROR_INVALIDDATA; + if (s->lshift > 31) + return AVERROR_INVALIDDATA; + q = quality[FFMIN(avpkt->data[offset - 2], FF_ARRAY_ELEMS(quality)-1)]; for (int n = 0; n < 64; n++) s->factors[n] = quant[n] * q; -- 2.17.1 _______________________________________________ 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".