From patchwork Fri Aug 16 23:15:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 51048 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:b6ca:0:b0:48e:c0f8:d0de with SMTP id s10csp734744vqj; Fri, 16 Aug 2024 16:21:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWmQSoO73jvoO+uTduoxLTktL7Q6JFAQeYw/6bhia7gM3+OBLEur7CN2nmtPyeQlvUb3hKrHp6BA4JytgYCFvKxIMVh5YkhuHMBxw== X-Google-Smtp-Source: AGHT+IHctJYKpMi31OJ81yhQnkg5lU1xW60yrmQHe0hFRyNaNrD4efSHH483eB+pS0jEjttANJ0I X-Received: by 2002:a05:6512:3c84:b0:530:baec:3975 with SMTP id 2adb3069b0e04-5331c6904bamr1817785e87.1.1723850476092; Fri, 16 Aug 2024 16:21:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723850476; cv=none; d=google.com; s=arc-20160816; b=SN90wLZriyqR9RvfE3gGKw9bx+22j/rDpi/U8tAhsctWd1KFd8jMq6seprY1wJaeUI KvJ3GyySxB9l44a8p9/O4FRkbr+kfHEe5fWpCl2XZ/vEcB3Rn0Ck+DWEfjlVkuEUTYkn RsoZNf6pvcsvICtQ43AtOZ4O7Urhq9gHWqYDEDdiuvmkge8qyqFFozEQSp6cpR0+XRIW //8zA6nA8KHeJ5jI8C0+HkoWk9zBA0hCT1U6CI4L4ySrygU0HGEqtRmWKttmGvELUekC Hd5zmyoocgUYKar+TjCrA6K3wI2n6oVStZrXPavWNevqjVB9NTxHDNnoFYO1qr5KSPOL Ejog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=JBUYAwdRM5eJDftEWGPkeWXEbhIOvfi2VhWmynLFitE=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=To2o3IiQtTtinDTUVJa0l+LdijyVKJK5fQ70UUeIwwtAimVSSxK3LXDpNJIzotaN2H Wp2AL+7O2AOw0F9FLMbRMpTbxzcKWdkQ22EbiZ1ZxI1buIuz0VXaCKgR1HZKF2Czg/CK lhpjSlkLpBxXNJ2S4sASuDJDqn1IBGbi1ewIE/CU7m/IV8wQn1ZYsUuH+29xXwP1cCDw sH5+Vh2oK0eDmZr+vFeH91uJc3NTv8HqXXDP+Tyf4BrKpb+fE3Jzh51ZWDH1LG44h2Hb RZ8/kGPmc6d7L0GGoKXZk9r6AONBHFHctoe3uotdsxO5WSmD/ZKDveA8cj/A5eUyaqDm 9jtQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b="e/4lH1qm"; 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 2adb3069b0e04-5330d3aa1b6si1190949e87.55.2024.08.16.16.21.15; Fri, 16 Aug 2024 16:21:16 -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; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b="e/4lH1qm"; 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 5D3BD68DCBA; Sat, 17 Aug 2024 02:15:11 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4423268DBFE for ; Sat, 17 Aug 2024 02:15:05 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id A734A60004 for ; Fri, 16 Aug 2024 23:15:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1723850104; 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; bh=KXcVq2EmQ4JRZDamMd+W8bqIjhk24WSMXY2l2LaINwc=; b=e/4lH1qmPH1wojC6Wk7Q7xsjUsGoJr1g4dNyPR5Fc1ridjN75/7LYdv33IPao/FBsdXHQu BBmYr4UKfRAtRPUK38ofLLe0K4QylVI00ZrrcXcpGdivU+UeVATpD6DdA69Yw3qzhr2WPO rB1Eye9RSPmm830TRZgijeEvQEhcXXc1RZP4p2RBR4WalylkkQfnQ3z8efJirtdoVPpn9j UxcaW0MEwSMU0RHVyIWp477jBdmsNv3mlQ5ywD8LqW889+E2M//oWWWPI9eD5Fg9QsH6nh qOP3rHPGP0PKK/NXFZn+MksRDpyGwMafJpHX7AQnY9NLhUXk7TjDiOKWXtDCxA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 17 Aug 2024 01:15:00 +0200 Message-ID: <20240816231504.3166080-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 1/5] avcodec/get_buffer: Use av_buffer_mallocz() for audio same as its done for video 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 63eV9Sh0yk1g Fixes: Use of uninintialized value Fixes: 70993/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-6378949754552320 For the AAC/USAC/SBR code which reads uninitialized memory, it would be good, if it did not a fix for that is welcome! Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/get_buffer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavcodec/get_buffer.c b/libavcodec/get_buffer.c index ff19f61e86b..7e705380fc6 100644 --- a/libavcodec/get_buffer.c +++ b/libavcodec/get_buffer.c @@ -142,7 +142,10 @@ static int update_frame_pool(AVCodecContext *avctx, AVFrame *frame) if (ret < 0) goto fail; - pool->pools[0] = av_buffer_pool_init(pool->linesize[0], NULL); + pool->pools[0] = av_buffer_pool_init(pool->linesize[0], + CONFIG_MEMORY_POISONING ? + NULL : + av_buffer_allocz); if (!pool->pools[0]) { ret = AVERROR(ENOMEM); goto fail;