From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 5B98349CD7 for ; Fri, 20 Jun 2025 00:34:17 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id C104468DB7F; Fri, 20 Jun 2025 03:33:13 +0300 (EEST) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 5DED968DB04 for ; Fri, 20 Jun 2025 03:33:03 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id ACBA843EB4 for ; Fri, 20 Jun 2025 00:33:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1750379582; 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=P8B+vhtqMLljaZ6bCJfPUe6PVujLh4/ePfetw+Idu0c=; b=PEVTKAZ5gckOR6kEgV6hfTvefPYKW7RKAzZC4kpEnsqIjjaOZZHVp95XqOzHukjvuRdxHZ tTwZQo4LsKX2V9VKUJtvWXD9TamBl62UOvaMHmBHNJORk0rZ1fT5oASW4Rs3nTQPRHNqYV NEctPvWNFn2Sp96FPLSXNh+mi5L4iOoH9qqY8iWGNq3ZZ5wLu6pH6uNf9AqeDtpae9tYDy LCan7/GBYDg6bGZ3FEtkWHfPpAvvWk4uQmiWzrhW2kKo6pRQDkfM8A7PDC9TpaYCeTtldz 7X5Ym2fYhdDyv58vNj1vnBDYik9LYLXQtsAN5fm8PB+U/s2s9vDUF6TRfnbj4A== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 20 Jun 2025 02:32:54 +0200 Message-ID: <20250620003255.295598-7-michael@niedermayer.cc> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250620003255.295598-1-michael@niedermayer.cc> References: <20250620003255.295598-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-State: clean X-GND-Score: -85 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddvgdeileeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculdduhedmnecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefoihgthhgrvghlucfpihgvuggvrhhmrgihvghruceomhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtqeenucggtffrrghtthgvrhhnpeegjefhteeghffgledugedvuddvffegfedvtdehteelhfeuiedtveffveefheehgfenucffohhmrghinhepghhithhhuhgsrdgtohhmnecukfhppeeguddrieeirdeijedruddufeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeguddrieeirdeijedruddufedphhgvlhhopehlohgtrghlhhhoshhtpdhmrghilhhfrhhomhepmhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtpdhnsggprhgtphhtthhopedupdhrtghpthhtohepfhhfmhhpvghgqdguvghvvghlsehffhhmphgvghdrohhrgh X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 7/8] avcodec/vvc/cabac: Check k in kth_order_egk_decode() 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: The return value is int we can thus not handle 31 or more bits Fixes: integer overflow Fixes: 418396701/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-4730994378997760 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/vvc/cabac.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/vvc/cabac.c b/libavcodec/vvc/cabac.c index 6847ce59aff..78703cb065e 100644 --- a/libavcodec/vvc/cabac.c +++ b/libavcodec/vvc/cabac.c @@ -937,6 +937,8 @@ static int kth_order_egk_decode(CABACContext *c, int k) while (bit) { bit = get_cabac_bypass(c); + if (k >= 31) + return AVERROR_PATCHWELCOME; value += bit << k++; } -- 2.49.0 _______________________________________________ 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".