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 ESMTPS id 2F7A44EAB7 for ; Mon, 12 May 2025 23:59:08 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 11463687DB3; Tue, 13 May 2025 02:58:51 +0300 (EEST) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6394B687A9C for ; Tue, 13 May 2025 02:58:36 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id BD1A34396C for ; Mon, 12 May 2025 23:58:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1747094315; 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=2o1yH27IlcmKRi5wgRZcm7mm47wvGdlajOrHwQjiw4c=; b=UddshazZiPbKCNJPiJ2ISvIEhXHWN6/4FQvwXzUiTPJmYHL3kZLDjGdGBCfbqYN1c/pbrL xlwbBemI7ZZFkiwbvNtWH877AAqSb8Q8UbttytN550UTEkuPaJbeVoImMOAIKT5zJro6DR 8HQq322xjYxXt0vwUQmLjWzDrltTI34IlSzcrAHr/8BvKJ9Zia7ZGcYoLN26mES3FyWho/ EKbUpxU0NJHpb8YAXbH4x5nNVqmOkXezFiub+AsfnhON+ABxQM+O9mCild1UtLswsoRY08 n4AKmVYlmX+GhjOV9gzVOBw3vUm+z+dQ0FbDoT5EbqZptePNKvYqGnQ2l2HZzA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 13 May 2025 01:58:30 +0200 Message-ID: <20250512235832.361422-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250512235832.361422-1-michael@niedermayer.cc> References: <20250512235832.361422-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-State: clean X-GND-Score: -85 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeftddvieegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculdduhedmnecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefoihgthhgrvghlucfpihgvuggvrhhmrgihvghruceomhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtqeenucggtffrrghtthgvrhhnpeegjefhteeghffgledugedvuddvffegfedvtdehteelhfeuiedtveffveefheehgfenucffohhmrghinhepghhithhhuhgsrdgtohhmnecukfhppeeguddrieeirdeijedruddufeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeguddrieeirdeijedruddufedphhgvlhhopehlohgtrghlhhhoshhtpdhmrghilhhfrhhomhepmhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtpdhnsggprhgtphhtthhopedupdhrtghpthhtohepfhhfmhhpvghgqdguvghvvghlsehffhhmphgvghdrohhrgh X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 3/5] avcodec/takdec: Check remaining space for first predictors 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: Timeout Fixes: 403673829/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TAK_fuzzer-5498240154009600 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/takdec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/takdec.c b/libavcodec/takdec.c index 74c8d7c7a8b..1e6e6caebda 100644 --- a/libavcodec/takdec.c +++ b/libavcodec/takdec.c @@ -434,6 +434,9 @@ static int decode_subframe(TAKDecContext *s, int32_t *decoded, return AVERROR_INVALIDDATA; } + if (get_bits_left(gb) < 2*10 + 2*size) + return AVERROR_INVALIDDATA; + s->predictors[0] = get_sbits(gb, 10); s->predictors[1] = get_sbits(gb, 10); s->predictors[2] = get_sbits(gb, size) * (1 << (10 - size)); -- 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".