From patchwork Wed Jan 11 23:54:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 39981 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bc95:b0:ad:ade2:bfd2 with SMTP id fx21csp5132540pzb; Wed, 11 Jan 2023 15:55:03 -0800 (PST) X-Google-Smtp-Source: AMrXdXuDW1zqQUqwFXUEhgC2+lBTAAej7sL4r7AiS1t3yqdAR4LiY0Sz4D2c5wbjYz5H5U6rLmed X-Received: by 2002:a17:906:3b53:b0:863:3a9b:6a79 with SMTP id h19-20020a1709063b5300b008633a9b6a79mr1912603ejf.63.1673481302935; Wed, 11 Jan 2023 15:55:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673481302; cv=none; d=google.com; s=arc-20160816; b=QBk11kIDKneb6Rjk9uxANx8wMEBj7tDubkMpsHIxPZbsifyjmv9Z9j+pGzr9dZdQQB obGDByxSbRnIGUk9h8u+WlywZ67/I20nMnDGQI5Qhk1kPY6bxPdtOcWCXyhAANBUV+wy P24RNbWnbYUrLt16+FmjyJJxYq/WVVlfgZKvodVcgQELZFIVshF0ScsX7M2aKoNLFHZe 89m9C23R/n5HJTsyzvppTPmru9Wysew5WW77ItBwpNn4V5cpaQ54/SChd/RF/Zx77k3Q xIFWBeRjk/FzvcqUH8QgzpSes899ieiiUlY1n6U8TNrIWC8F98/YR86uOQv6k0TagfTi 10iQ== 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=FYtyuQX3jK3/CrDIkvDftjPpLSGDDr2Bd8/C9Updu8A=; b=NTiY6wTCR6vLZRhFyTgRhdXUW0M9hms1VkYNB+D1dmSxOyPW4tdz8e7ZxLGBOf4Kbv 2jifPEgtqdDU0r/kc6G78yZnpbfkoSa9R2bhDpiQAkHQmp/qwD+S6aMDFJcKYc69wQMh Vruj2uQlLdiX10jnWe7kQ9vYtVix8S8Q3nO9tEN/3+A0J2Kkju7QIGJLXJEtB6Y6U7oM r63/mdjUy8qeKsOYb8JIy9ArYTHCubC1NTKeBEechSEP8tyjuWfWpSYEPogXy6M1xpNE /+oBtzqgA9qOZwHbG66ULVd4/UMPWLXOhPgh4GpUgtLmSUOlnz+/jiz2ysUsKREEZG8Y nfWg== 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 hq23-20020a1709073f1700b007c0f2133931si17124733ejc.520.2023.01.11.15.55.02; Wed, 11 Jan 2023 15:55:02 -0800 (PST) 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 1DDA568BD96; Thu, 12 Jan 2023 01:54:44 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2125768BD08 for ; Thu, 12 Jan 2023 01:54:36 +0200 (EET) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 723DF240002 for ; Wed, 11 Jan 2023 23:54:35 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 12 Jan 2023 00:54:29 +0100 Message-Id: <20230111235432.2135-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230111235432.2135-1-michael@niedermayer.cc> References: <20230111235432.2135-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 3/6] avcodec/pngdec: dont skip/read chunk twice 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: ImjKiWHYXGkA Fixes: out of array access Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PNG_fuzzer-6668158952144896.fuzz Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/pngdec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index cb4162d2ab..95bcfb514a 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -1231,6 +1231,7 @@ static int decode_frame_common(AVCodecContext *avctx, PNGDecContext *s, } av_log(avctx, AV_LOG_ERROR, ", skipping\n"); bytestream2_skip(&s->gb, length + 8); /* tag */ + continue; } } tag = bytestream2_get_le32(&s->gb);