From patchwork Mon Jun 21 21:25:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 28594 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2042:0:0:0:0 with SMTP id z2csp2347934iod; Mon, 21 Jun 2021 14:33:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwU4vc+A31cBPMMJpAMcaV7FDba4tpZChoevySmraTYiv8SIHktAgeB+yxX4dBicxo+fPgw X-Received: by 2002:a17:906:4786:: with SMTP id cw6mr189022ejc.353.1624311195513; Mon, 21 Jun 2021 14:33:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624311195; cv=none; d=google.com; s=arc-20160816; b=z1LqQOdxZJErubnUYQTRIVFgm9Z+SIfq9152Sjp5yWC4PC9kzfkRRQeDWKIcAzOhr0 DIbOfDwhXZPjXINBI513SkyZiKoRYMZ/X6MxtFBbD5zzWY6j9bWpBJsknoXsGQYFFTPG I4vgYwykCesFgZ5kJJE1Z7uy236K3oI37QnX3CWol9rKKKNHOBAAeI9NGP7v8/FvEOVW /JZEsFEBpOVjeI+dwPuuUPEkDI371QiFf5KFLXyWMEdJYn6xAd9MXR+6JK7dasXH9Gze HBs+2V7Xwno10dv7UmK3puRQFWHwRHUBnScfDYX11Ayj8Yw1U+1hoThIqJbH3hyPw7H/ y1rA== 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=M5ljWj6wu1pmOkrG5+qzFNOLI0yrVdE8vmajdHNjFq4=; b=KIuicmm4zK49LY0iPQdADIANOYiIiIj7fqSzS5AYKUiiV6t5B81R9Rr8aZ9J4dABpY EqxUu8vUjTwpuXUAKlKrnH1jW3Ayn9t2/9rBptt5AYft7XeVA0+8beLySq36+SPp2IZ4 fv8OVR1cKiAE5XyxXhrph2neEM461RMMCfBVQOi/FkHNB3Eo/SRFKmgqBPn4wQs6d02A 2Xnw8Xoy9E95inXk/zpHvUkCP/EigOS/f6qckjFpis1jYQPz7nT2YWEghd3Y1qjb0Q2r 6UhqzqwjnEftlLPaSeTSI9IiDdZT0S7SAW8V3YuiM60J8L9AhE4+LhVnOQaw2Zu6NTV4 NbDQ== 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 q19si8716785edv.394.2021.06.21.14.33.15; Mon, 21 Jun 2021 14:33:15 -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; 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 7D364689B7F; Tue, 22 Jun 2021 00:33:12 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe04-1.mx.upcmail.net (vie01a-dmta-pe04-1.mx.upcmail.net [62.179.121.163]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4438A6807C8 for ; Tue, 22 Jun 2021 00:33:05 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe04.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1lvRRN-00Awh9-0E for ffmpeg-devel@ffmpeg.org; Mon, 21 Jun 2021 23:26:45 +0200 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id vRQPl0M56ljeHvRQPlc6R6; Mon, 21 Jun 2021 23:25:45 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.3 cv=BoHjPrf5 c=1 sm=1 tr=0 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=nZOtpAppAAAA:20 a=4lFjYQbWvxT0W21MsFcA:9 a=1fhp2MxaeJtTNGEnv6mo:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 21 Jun 2021 23:25:44 +0200 Message-Id: <20210621212544.15449-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210621212544.15449-1-michael@niedermayer.cc> References: <20210621212544.15449-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4wfPB7h9lGiyBCJka6qvSxX4Q4CEQw9jhheVzjosW0H0CvNaPBL8Gbu9HhVlRW+gx31IJvGa228r/d0bfGN/DYhsQC/F4T8L+UmlCblJJE0c0nKpp1A3C0 29wOyCEx7i1XfpAsCWeKaVP9SnC8ZjrE2CyuY+xhUFy1yrPa1KkO4wtp Subject: [FFmpeg-devel] [PATCH 3/3] avcodec/cpia: Fix missing src_size update 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: XrNspQqomJzh Fixes: out of array read Fixes: 35210/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CPIA_fuzzer-5669199688105984 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/cpia.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/cpia.c b/libavcodec/cpia.c index d88bd1aae7..a2ae16ec2c 100644 --- a/libavcodec/cpia.c +++ b/libavcodec/cpia.c @@ -111,6 +111,7 @@ static int cpia_decode_frame(AVCodecContext *avctx, // Read line length, two byte little endian linelength = AV_RL16(src); src += 2; + src_size -= 2; if (src_size < linelength) { frame->decode_error_flags = FF_DECODE_ERROR_INVALID_BITSTREAM;