From patchwork Fri Jan 13 00:01:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 39990 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bb05:b0:b6:a58c:cef with SMTP id fc5csp62516pzb; Thu, 12 Jan 2023 16:02:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXsnYnw5PLAbT8DGUGyzxEb/0Mss+Ox7SJBh4OB8+f9d9cnals1TV0iGqIbczKzQ92Q+1fup X-Received: by 2002:a17:907:d1a:b0:83d:61f8:3c with SMTP id gn26-20020a1709070d1a00b0083d61f8003cmr1669286ejc.3.1673568121175; Thu, 12 Jan 2023 16:02:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673568121; cv=none; d=google.com; s=arc-20160816; b=ui6o3Fh069fionKzr0/onLRNc1bLIZXRRDcA9jX0PLKM8VilabnISMaUqJclYvJ0g2 ixHTS6NL0xjNGDLfvVH2qR1PGzb9R69tzIyq8AOI45s48NTpWYrzQycV6jM29siimRKE ANUU01AvwB8gqJrbZeeUgDmXovVKncKJPiwzCCJsvyRQPJhE9yIOkeZkaUMeGzNQVZOP nxbpaHcmjAm0OZHhwyXD1mZ95vabgF7MZXjZnyuQbh8N6j8D0xSaVPvVxbga1wgeK1h3 5tx5trvGQ6haDvnnvwd/jL3OnGGAi2Q9rUcYC6uQnjOKvUQDjsYO6qk/QSgkAT7/JZPV GveA== 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:message-id:date:to:from:delivered-to; bh=myT0vVT2Qt/sIegxnf++qcNOvbEohtqMK7pY2IrC8sc=; b=NTPTGhQ9VyTDGTxiaRWTgbmNZXflA7bWBgbBl+1Wm+iep03Hel6/WewVrCMxwUrtjI l5rsVFYlo0Sj1zzb9mlTn3iuq7E2Ca2o+q7MUjacu72Iih8keTqOd+do0UIi21TaCOif sL4y1cUHKhdidZimKLLA7c+15kYj0kZ2CzTRcT6G0oXNAOVMrAQJO6I5SwGtlCxg27VC P/d23HI69jzVaVfqFiuDDNaM3FotP9y6L1Dhu9JyFCrmxtqUrgtEjy/HcG8gCXgcEIHE 9/f1ofAWfev3tpQMzBcabazTcp2Nqv7w1jjkQlCRpYFlr9ReDfnXgLb7B/dDEPQocyhv V3mg== 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 wg10-20020a17090705ca00b007c4f75345e2si21134695ejb.431.2023.01.12.16.01.51; Thu, 12 Jan 2023 16:02:01 -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 4AB30687F61; Fri, 13 Jan 2023 02:01:47 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1F9C2687F61 for ; Fri, 13 Jan 2023 02:01:39 +0200 (EET) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 3CA5920005 for ; Fri, 13 Jan 2023 00:01:38 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 13 Jan 2023 01:01:34 +0100 Message-Id: <20230113000138.9994-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH 1/5] avcodec/wbmpdec: use remaining size not whole size 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: Ul5haswXO9J0 Fixes: out of array access Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WBMP_fuzzer-6652634692190208 Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WBMP_fuzzer-6653703453278208 Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WBMP_fuzzer-6668020758216704 Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WBMP_fuzzer-6684749875249152 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/wbmpdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/wbmpdec.c b/libavcodec/wbmpdec.c index 9638b55b94..8b105bc135 100644 --- a/libavcodec/wbmpdec.c +++ b/libavcodec/wbmpdec.c @@ -72,7 +72,7 @@ static int wbmp_decode_frame(AVCodecContext *avctx, AVFrame *p, if (p->linesize[0] == (width + 7) / 8) bytestream2_get_buffer(&gb, p->data[0], height * ((width + 7) / 8)); else - readbits(p->data[0], width, height, p->linesize[0], gb.buffer, gb.buffer_end - gb.buffer_start); + readbits(p->data[0], width, height, p->linesize[0], gb.buffer, gb.buffer_end - gb.buffer); p->key_frame = 1; p->pict_type = AV_PICTURE_TYPE_I;