From patchwork Fri Aug 16 23:11:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 51045 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:b6ca:0:b0:48e:c0f8:d0de with SMTP id s10csp731708vqj; Fri, 16 Aug 2024 16:12:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXUmeu3b+tzMtlvX5AvHPyhbcM/ZL0gtZp96UZJyBeFkbcdHwdF5G+m6H1ePpMbn5GqLOvxEw97yTZJlCDXljzs@gmail.com X-Google-Smtp-Source: AGHT+IEU7lErxB5u8BlRwqK+v+RuMcaqZ8v081x1ETT8/Ym7KlIKRWeC1pRKDzlsZwZX5Lv/0I17 X-Received: by 2002:a05:651c:1417:b0:2ec:5fe1:c762 with SMTP id 38308e7fff4ca-2f3be60b9bdmr24554661fa.46.1723849948693; Fri, 16 Aug 2024 16:12:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723849948; cv=none; d=google.com; s=arc-20160816; b=Y+Y3vmhplarKPKFmFDL89tN1agcUNKnCwFPNIYn1o0cVB+ALJpkii1ThiqWUEIAwMm vPw//EFi9eL8tEAINsVLDGtVHpZbHnABvdyyRqqaBeVJEXMxxdFBw2XGIMQ9gJqrlUcn wW/vaJI7vbVVZ/XvNOTt5ewtMzRJ9sz//Imuea9yzB2HMxP+GwxrSbUm0lsYUzK8wpOB WDWQoggYbXz+A31T6fxTLStoW6X5D/gMgxI1laZdYYIvgCoOs0+Mt2EfEqK/YvoqeE6w +nAzQNyBTZyLCYAcT8lK3J0F08LgiRLzUisS1LB9Ktau4nrEb9SIhAr2G1DfMGs/KOCP n7UA== 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=s+vYlGi01viTdGRu6PoZo3JDHue+mMB1ygTo/b0a0dI=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=Mu7sa/bpKQi7MDogGQy7ElNF62j0sFhBo6v2SnEqFYfB0KMHHS3E91OjOLV7im4ung jrHZCzDKNWKm2p0x1Cbk7Yfu6YisDB7c/kpq9+/Bz/rDMo+HGIbsqVwBoUDSGAQEUzgW jT3KdYdACY+PPj4+SeBDHNx5OdtHpIpoNohSSFRljhzcJVrLJvPrI3Z0qdjCJFt0kPa7 XDqlhcZnAYnUTKbCo2bSBiwCKE3kl7W1pUIMHZ6sMz58yQySV8DnE6rU1t2HooiOoUXT VHvveE8juePKI0Wpv1U2YD33v6VYFHWs1HD3ZKcTpWXmP0i6ZKc2I2hbouejK+AE+tnH cR2g==; 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=obEGmnsT; 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-5bebbbee266si2587671a12.87.2024.08.16.16.12.28; Fri, 16 Aug 2024 16:12:28 -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=obEGmnsT; 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 E539868DC9C; Sat, 17 Aug 2024 02:12:08 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 68F2268DC97 for ; Sat, 17 Aug 2024 02:12:01 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 9C6EEE0002 for ; Fri, 16 Aug 2024 23:12:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1723849920; 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=NS3DjUc96qAT25/H7v8oPKhWlIBfUFgEOR9zfSLEe4o=; b=obEGmnsTQxri22BQ26QCuFq4Ben/38ngc0RV+PkQKyzo38Ou/GFKGv89vrehD2/HwSXXrI MRrzwIm9D4mWcoDBcz+AUhxubydPTPDfxDLM1hRZ1YDDAKoHQ0s/WRszp6Rn4H/mesBBB9 Wei/hXqABqDCc3BQ47G1lJTpnlLQXmg/9kPwITMea6vqDn3a3D656dr/GNDvERflq69G8V TLdwF0qWo7wHH9rPn9UAzMhsSxsaDQj7mqCeM3QwIcbXw7CfwHX7hiEa20SjBP/FxFQmXZ sdvD8TtTrkwuscGQLnwfb7xuCd4Gb9Q+di/jzl+To3B+GgzUTA/3GdP2BUrjyQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 17 Aug 2024 01:11:51 +0200 Message-ID: <20240816231157.3166012-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240816231157.3166012-1-michael@niedermayer.cc> References: <20240816231157.3166012-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 3/9] avcodec/webp: Check ref_x/y 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: k2EZVxkvbrwa Fixes: 70991/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WEBP_fuzzer-5544067620995072 Fixes: use of uninintailized value Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/webp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/webp.c b/libavcodec/webp.c index 7c2a5f0111f..b624458d675 100644 --- a/libavcodec/webp.c +++ b/libavcodec/webp.c @@ -704,6 +704,9 @@ static int decode_entropy_coded_image(WebPContext *s, enum ImageRole role, ref_x = FFMAX(0, ref_x); ref_y = FFMAX(0, ref_y); + if (ref_y == y && ref_x >= x) + return AVERROR_INVALIDDATA; + /* copy pixels * source and dest regions can overlap and wrap lines, so just * copy per-pixel */