From patchwork Sun Aug 4 20:53:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 50894 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:1f5a:b0:489:2eb3:e4c4 with SMTP id jm26csp1050658vqb; Sun, 4 Aug 2024 13:53:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXD8aiqZwaRDJWP90ZeiJiHQW285IrD2gauI7zelcEHkJN9L/bI5NGofHBTc5u+TAMpqcW/feINcNQQKgvQMx1QB1cOUfbjZN2Cog== X-Google-Smtp-Source: AGHT+IH6469T1xNvt3V0X9g/24auD90H5K8GeUWnTUHRDFTWvgDOMJlEnr3JRY+25/TeyW04t56F X-Received: by 2002:a05:6402:185:b0:57c:aab2:7311 with SMTP id 4fb4d7f45d1cf-5b7f56fd9f2mr7366056a12.29.1722804830976; Sun, 04 Aug 2024 13:53:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1722804830; cv=none; d=google.com; s=arc-20160816; b=LEG7+I8r+c9TsqmDgjJmzraXs7VK0SeahmrIwJKL9SkF4+6EvdLlqdqqzveHrDTCRq x7kRqk8+Ef2A+NSN3bxyKBBfHjOnbh3rh57kOf6t3+mAN6k6H3P8WlzM6QIMoUFKQGnc ZWfRrICbJB56dWmJF4KSS2jExKWYv7WVn/zRhyCAAuGD5P+2njQ/zDmYhRo13UjAjCAN QMByyqcVKOxfirx/BXoUJlxRSJAzHUBx0bFFA89XBly5PaKHSEf8SbiCzmO3d6a9iBch /EqTQQfG6KzSP46D5ZUC/RQLG5f6F1XZB+j+297QVbgCDehAcbwuLcKYPkkWUiVB4U74 Lmcg== 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=dsQ2CaOUgC/MQBilh2EKx5KhEYEUv+dowjXuzDuPqqc=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=CEuL9CAqtev0bwP/R02mJyDSCJiI0gZuLHc9rIbjsjaDD7q3COkY9imvLx8Yj0b3i4 2GAb1X13Pk4MD+4eOKYAWviRws/37zzrt42nHVsAegAIAfONTzNEBtNoNT2kMDEEzvJP 5NdW54nVDuDF/uBkCLJnPMZp91HBNBGCIHdULOJG6szLVOUkMLgBFm/S6h/8mpmhHUO6 vejVjSC4u28qYIANTEx6dPcpfAA7Jwb03Hs/4VkKmrn+peZMevnpm0RNAu6BxVPk9ifq xHpBtlzpk4MJ0a++3ftcE2Q3lXc+KaEtdJ9dPA2He54eqBbzHBUDNd4mewObI33T6yVP Qw4A==; 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=g32RuzjD; 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 4fb4d7f45d1cf-5b83c61c85esi3566102a12.541.2024.08.04.13.53.50; Sun, 04 Aug 2024 13:53:50 -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=g32RuzjD; 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 2C2ED68D96E; Sun, 4 Aug 2024 23:53:22 +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 C3C8768D88D for ; Sun, 4 Aug 2024 23:53:13 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 2C87F1BF204 for ; Sun, 4 Aug 2024 20:53:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1722804793; 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=xX5BXjIlQTCuXuFpdry5YxBamk+71Ghl1vwv0uf634s=; b=g32RuzjDOiWsGYAD+aS66Fr9As5p08Xt90JV9TzsijPoc1mGjUX1hXq1fHALfXmHbmbMxw y1nVbWMxYzWc0djA4nWJeZ8Oq6kGICc7mKab41otCOqMVLdpAXdgEoIi7V+01FUFVmS3u2 8k/+KCu6IiA+jSl6C9EblgQtQmUio7j7Iji7jjv9dDW7nYhC4rXP21pG466B5hXQPkF8yF QXoX3+iIFSZjd/N+JeVy+WxMunhqfXZ7U/qNYXEcb4S8wJkvQRq6GlPzKYssJi7iD13jBm Rj9/aMgrOZHQtyIpHWJi1/9zdhBM0DY7+yVbuJhvMN8bfzBB0DALz8f9tH6JYA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 4 Aug 2024 22:53:05 +0200 Message-ID: <20240804205309.1978196-4-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 4/8] avcodec/parser: clear padding in combine frame 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: 6q8B7TOri3Am 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 --- libavcodec/parser.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/parser.c b/libavcodec/parser.c index af17ee9c156..426cc314fb0 100644 --- a/libavcodec/parser.c +++ b/libavcodec/parser.c @@ -236,6 +236,7 @@ int ff_combine_frame(ParseContext *pc, int next, } pc->buffer = new_buffer; memcpy(&pc->buffer[pc->index], *buf, *buf_size); + memset(&pc->buffer[pc->index + *buf_size], 0, AV_INPUT_BUFFER_PADDING_SIZE); pc->index += *buf_size; return -1; }