From patchwork Thu Sep 21 18:09:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 43868 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:38a7:b0:15d:8365:d4b8 with SMTP id n39csp310202pzf; Thu, 21 Sep 2023 11:09:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEmYrvwDwH3QzObfOBaolq/lK435P8YqcljlY38DCAh2+W3Gw3MCD95MNaiqn+BzyQJCouq X-Received: by 2002:a17:906:8a64:b0:9a1:a916:17c0 with SMTP id hy4-20020a1709068a6400b009a1a91617c0mr5905695ejc.50.1695319785394; Thu, 21 Sep 2023 11:09:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695319785; cv=none; d=google.com; s=arc-20160816; b=zaY6YUKe2Iluws2uIFZ0GQp7s71Cuh3Ehwn1S57YnTUXnHe37U/A445iZjtgQFYGD3 eQdxHvCByIbe+18F5PowpAJ8kR7TNO3RNChZGDRFcEI7QMt4DfwXk9+kBDhnh+4mgP1H Dfe5cgJI4k2/F0KVZ9QVD8gp8PE0N48bGfC0MCVT6mXhKoEn4W5G9yctfuk/ysMpAqp2 TLNeUMcb0oEAxNKW+qbyegtn1weBvzfv+X8O3XRBhtZkAfe1ltqjM0NbdSs9Jpl3Qeq8 m6L9Kn0cPqmDyh8zZtK4z831C7zXdnqPoiyB2KLYmH69ip5DeopqwVlZ1LVUah7NmAvP /wcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to; bh=7Aws08AHz7fS0Gte8WCzNB1NF8LbLQ0lqaNm7j8Dzfk=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=vC+0u7DKgaNHm3T9i5DNte2+D8O+oKe0rQgkOAxezCe2ZXm7QNC6bC4lPqLuQO7n5C cYeB1KpJ47FRFj8GXmuKFSuaq8spMramp9oF6P4OgqJrum0Wv6MMbcOZwDnpENR8qw+a WkN4hCu5ZBwqgNYT5Lfy81PuaX7lb15Vkbbm+xLMSW2LsWwdSdW58I1Yct9LXvobtK5i 58Nq/jEzDtQoCwipOyDbE5+98mDmjPYopcChozpBr6sYHzJ5cl3fu76aaUm7H9IU9LAl Gq48GeOYparshphO90lE4KSARlSkekmKfi+yFVUybTlYDa8K/0Lwic1OaoNZqfqCH1q1 wokQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id j21-20020a170906051500b009a2154511e9si2067529eja.50.2023.09.21.11.09.44; Thu, 21 Sep 2023 11:09:45 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9CC6368C943; Thu, 21 Sep 2023 21:09:24 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 736B568C83D for ; Thu, 21 Sep 2023 21:09:16 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 90266E0006 for ; Thu, 21 Sep 2023 18:09:15 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 21 Sep 2023 20:09:09 +0200 Message-Id: <20230921180912.10733-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230921180912.10733-1-michael@niedermayer.cc> References: <20230921180912.10733-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 3/6] avcodec/wavarc: Allocate AV_INPUT_BUFFER_PADDING_SIZE 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ReoYj1qNJ1IN Fixes: overread Fixes: 62164/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVARC_fuzzer-5963163952349184 Fixes: 62164/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVARC_fuzzer-6048030137909248 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/wavarc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/wavarc.c b/libavcodec/wavarc.c index 48c673fdea4..9ba95143b8a 100644 --- a/libavcodec/wavarc.c +++ b/libavcodec/wavarc.c @@ -111,7 +111,7 @@ static av_cold int wavarc_init(AVCodecContext *avctx) } s->max_framesize = s->nb_samples * 16; - s->bitstream = av_calloc(s->max_framesize, sizeof(*s->bitstream)); + s->bitstream = av_calloc(s->max_framesize + AV_INPUT_BUFFER_PADDING_SIZE, sizeof(*s->bitstream)); if (!s->bitstream) return AVERROR(ENOMEM);