From patchwork Sun Aug 4 20:53:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 50893 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:1f5a:b0:489:2eb3:e4c4 with SMTP id jm26csp1050625vqb; Sun, 4 Aug 2024 13:53:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVGFRJ58vb+tmL6IJ9LaGDQbXfOdQMO9NwM7H3gYQAV39n7EWp2tWw8nycRqVEHq/mtqv6iKF2zscrFaf2ZbtTrKY/A+kS5D5j14Q== X-Google-Smtp-Source: AGHT+IF1p2KSD7ZvOG0lD2rIPwZIbadLysG0+bawUnWQPPwIfiPctt+kn4uXv58vnUm4WDXmF9Ok X-Received: by 2002:a05:6512:1111:b0:52f:c13f:23d2 with SMTP id 2adb3069b0e04-530bb38101dmr6704334e87.25.1722804822345; Sun, 04 Aug 2024 13:53:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1722804822; cv=none; d=google.com; s=arc-20160816; b=X5CQiAdKkLCcyZcpGPuA0xDVBXEdpAZOZbcGsPJqz0FKrOBX8qAPE2jIP0Q8W4eG04 VMe9H6PAM/LQ+Sy+Mih1b1GA6XrwJc647aNGIjMvVnITYw+tH88HMMTGlAiUplsg4/Hn 1SqZexHg4iJ+2XyVIzPFl/rz70+bzOhhq/EI8bAYjURdqH1/Mi5RWEAxvR/Jo+BYBkNX 1WGGwZW7CDKurjSAoYJr6HX4Fmko0azB/52LTgwJJUcWQ5Yojvqdp+gHNkPH/LicD7l2 yYV+nxyRvT1MVbwTQqrBJ3klbe0rziiBKs8t5b3EUaP4oGyBDTFNdPjcB820yVAUuYEa tgfA== 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=lpW8oJc4rwjlw4bZf/u2s/FBIaiPEVUvjyY8BnUowNM=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=NgdiRniTJHRJwP7CKEo7mkt9RZEKrsoK8o+Lz0ndloEhwSNeoB6mBfh3+owZbUr/t4 0Us97Ro02E+M9YI5s3JzgNfXYpbg4yoN1Owc0OknK4laPdU00IzCRWZ8jo6KTNuXApC9 OHOWbRVfb8GWZobHynfBxrc9Ny5RmMq34xkdGKfliNkfR4HgFYYJd7H0F0zlzIz/+jkI 38bp/Ul2O0XMt7gy1hFlqbKh/GeWGmvBOpZAv4ubcQ6Be0HedR0HTW36cURLyVe/y5F0 xhWvzz7XAH2WdT5bHK3ftzicCPU0KryM+l4AQCQEzfzOP7txvlfp4F2R0X7GQDDya308 /iig==; 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=Hw1gPwb5; 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 a640c23a62f3a-a7dc9d68a79si354776466b.302.2024.08.04.13.53.41; Sun, 04 Aug 2024 13:53:42 -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=Hw1gPwb5; 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 B94F768D795; Sun, 4 Aug 2024 23:53:20 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3F3DC68D20C for ; Sun, 4 Aug 2024 23:53:13 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 7C63F1BF203 for ; Sun, 4 Aug 2024 20:53:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1722804792; 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=Sq7fsOIXDtotQ+WTn8a3zqGxmLFQsQ+5amFifnAgpuA=; b=Hw1gPwb5l4nCIPxFeFR27ZWhSdHPLPtrGNmNEZk0HIgLSmuChr9OONUEHfV6C9u1m6UGXP diZNUOpChMT6XBI2Fs4WEZmjygjPYEr4gLzvkwtsAMizcVzyG+JWs3a8My/dy43gW89YmM UL81itmjOM6CdBQH+9HRnYZVgGoa4Lxu0Mg/+1zVsH/RxVTGjD1rnFValxYT0IjEg3yeBT wMw5t13Hm7J4wMIkgFqtR0j1hhCoXWtAYBuHWyafVlWoF63PP7AAh73k8zJfdCqcnypmcH goFeD/y8a1kLPJcjRHGSGtqmh+eOgMSPSbBWCw8cDGGm8FHvIVdhV/36RhF+Lw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 4 Aug 2024 22:53:04 +0200 Message-ID: <20240804205309.1978196-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240804205309.1978196-1-michael@niedermayer.cc> References: <20240804205309.1978196-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 3/8] avformat/img2dec: Clear padding data after EOF 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: tBYCKRNDBUv2 Fixes: use-of-uninitialized-value Fixes: 70852/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5179190066872320 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/img2dec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c index 20b1bc31f6a..3389fa818e9 100644 --- a/libavformat/img2dec.c +++ b/libavformat/img2dec.c @@ -563,6 +563,7 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt) } goto fail; } else { + memset(pkt->data + pkt->size, 0, AV_INPUT_BUFFER_PADDING_SIZE); s->img_count++; s->img_number++; s->pts++;