From patchwork Wed Aug 14 14:34:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 51018 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:a746:0:b0:489:2eb3:e4c4 with SMTP id f6csp962213vqm; Wed, 14 Aug 2024 07:41:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWE2N/P4At2jGUUH5AWxPLMDAZS1QsIYYic3Io3zSEID4mtZhg1n+Qd1zQ2qMZvps0vSnvvV02WDPWvcOTn1GJNEysL8iQb5p8kjw== X-Google-Smtp-Source: AGHT+IGOqZTLa9x5J+CY3gmOO2v4hJfUu+e1Zire3q/hh/T8tTQDCMV3KbDCPbvioPOQCavgdImm X-Received: by 2002:a05:651c:1543:b0:2ef:2e9b:c6ee with SMTP id 38308e7fff4ca-2f3aa1c9d99mr10386521fa.1.1723646476494; Wed, 14 Aug 2024 07:41:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723646476; cv=none; d=google.com; s=arc-20160816; b=Q8k653BsRrNwYgG0nZFO/MC1fBIXXgHgSyw/EKiJZMhW9c6+s464RX6y2tJfVuv8/9 iEKYxSo+oaGiFCQ5mzVVXg8Iym4yP3T9z/9x0aFlfqIxEgtNhe0O8ooLcW7/DFYVRDnK 12Rj8b57us/NGyemNO9Y8NhmzsQkfYXgcRBROwmb/9pJeJARiJHUXw91CBckNrgu2ZA2 VYlLeKXlQ1BDsgqHY6f/IXX0J5IGibvim2VKExIM9N/t+geXxAIDhFjRY/5LXSv1xaC0 OMqg3g/1w1nWsW5/xspqfeE7GUJZMneqPCBqyMCgRYBts6UkYvMPJrysLIrjX24OX4ou Vssw== 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:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=wDpaBE8cYOz44V5lLSEJNst/Nvck/qQp92LRjeXN538=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=XY3AvW5aoW75hcnJUMVrTUgaI9PwAEb2s6LYK/NqSzrm5csfnO3e1yROWy9X7E/Ene 8MPIeNudqpHw5QJkE5faZuGOH+MdcAc9ytZccvDja8AGgvwq7Un8MMjmUdpHLvzhFeZs 1Z0kn9j3k+9/edzb1ubhEQ9cHDDfDmHftPfnUWXpC8gu0sUyqov7f1yvu7ZZHP6F9u81 S2h96QCVSUZT1o1hDaXT8Mfx45bmZyu/QE5jexZ55ncSpKWY7I0utKej7gKkH+zlmzPM FlabRcLUnqP6TTldJcju1WvF38U6444ULSCWpUlnW5RErFMvMG0TLTEER3ADgnoKMz7K FaJA==; 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="kWKZlY/M"; 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 38308e7fff4ca-2f29203ccf6si26365361fa.267.2024.08.14.07.41.16; Wed, 14 Aug 2024 07:41: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="kWKZlY/M"; 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 15F5068DB6E; Wed, 14 Aug 2024 17:34:33 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7F77468DB7A for ; Wed, 14 Aug 2024 17:34:25 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id C1CF424000A for ; Wed, 14 Aug 2024 14:34:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1723646064; 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=kcQLom0q5HVV9aorqbG/4WPH/nGEtcxcvshcpP8tvxg=; b=kWKZlY/M50nOQYeIqqWy3ctBGuW1sO8zsPTi6j4zOrc7c1cvS8X/6i+PiGCct5JEtigQz5 Hcy+60qMoqTkPXSAXgOyQ/GVeWFLTaWsYMSuRovHAd8VY0Qw6ODC/E1e4Cc6eQ7+71HGZI 0rWbH0xGZYWn32B9TUl60CYg14RHUetTKm4Sw6S/Jm4Knt4OL+Okj032MRE1+hxm638YGV RNTPtA95HfwehPXIoj6/KT4+5shJXnwobMryYO0kah6U/JMkGjUrfj+3xi8zewDv3cPkQ6 Br3ah2t+0tmQgO0pQ1jqVaV2ah6nYOagJewhmq4W2f1gnT8iOXsmnZVMRwl3QQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 14 Aug 2024 16:34:21 +0200 Message-ID: <20240814143421.3990034-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240814143421.3990034-1-michael@niedermayer.cc> References: <20240814143421.3990034-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 3/3] avcodec/hapdec: Clear tex buffer 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: wCgIWhCvsapf The code following makes no attempt to initialize all of the buffer Fixes: use of uninitialized value Fixes: 70980/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HAP_fuzzer-5329909059223552 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/hapdec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/hapdec.c b/libavcodec/hapdec.c index 918eff78761..70bf592f2aa 100644 --- a/libavcodec/hapdec.c +++ b/libavcodec/hapdec.c @@ -310,6 +310,7 @@ static int hap_decode(AVCodecContext *avctx, AVFrame *frame, ret = av_reallocp(&ctx->tex_buf, ctx->tex_size); if (ret < 0) return ret; + memset(ctx->tex_buf, 0, ctx->tex_size); avctx->execute2(avctx, decompress_chunks_thread, NULL, ctx->chunk_results, ctx->chunk_count);