From patchwork Wed Jan 11 20:42:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 39974 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bc95:b0:ad:ade2:bfd2 with SMTP id fx21csp5037857pzb; Wed, 11 Jan 2023 12:42:45 -0800 (PST) X-Google-Smtp-Source: AMrXdXsoVDdLJM0QjD0Wk68Gi5iC2qbqHkhU3prWXg3OsnAmtacJelm+YAYdLl5BFmom11bJ/FxT X-Received: by 2002:a17:906:a18c:b0:7c1:5467:39b1 with SMTP id s12-20020a170906a18c00b007c1546739b1mr65115004ejy.72.1673469765725; Wed, 11 Jan 2023 12:42:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673469765; cv=none; d=google.com; s=arc-20160816; b=ylxtQSvXeGY7UFh/D8OYtXyimqDBvVmEpC5GlIH9x7m76KH4nMtSTe2Ft9sFTcbNbe CTSQJf2MiIrtcqKC7uqJlnLv1LWT0FaO49TByt413FWh1BuY8NlvcoEizf3nDm15MnPi lT3bMhjxnGbYzIOfqez8nUb2uED/4GGzQ4fNJXFYL6D+1lQy4+V8y8mHqYbEYkkpObTr VyAp0qxz93wdU2Dxvt3smMbsVcze7lhunHWa0HubOIMRYfTj3PVJ/sNauM1vP/SyYyR1 W4WujvsbtZ8ak6Lp+WBC+6+lDMHlm9otfaQovNJC4Q74ZpFm5Nvcpl/A5hesYve6hEYG U5CA== 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=0SE77B20g4J+rNfieg5Tmw5z4G5WRsBq1bPrleQuNLQ=; b=oxGaiwYa22aKW0r6ewofhGz1dUn7KJzJLp6hWZL+4HSS20h8xCNnipANLPQGXGSFsi d3QmEprlvGcHH4UObI+JKZn7m1DuSn5p1Z7zHYGdzWVXV6T7vfHTAk3Uli7CcwnWNqol b7Ej3FfrpDc5MGWER7qv2QT4eWVOuadafCWofK0ARq8j3gkHVptpvzCDsIE289ug4Yzq IMRO1Wvn4LSdUu/hBjoDQcHNsU1kuzeTO2TurG+LcP5k8ZuspF9r2Pw+cOkmsHMI7YS9 pbJAKaoWTMgqqcKYzdRpyqeMSh6pPfaiZSEoE4zKYP2XYMlaj7fYxl4OUMpdVD7Fg20W s4Ww== 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 xf5-20020a17090731c500b0084d4cd2dcc6si8331988ejb.598.2023.01.11.12.42.45; Wed, 11 Jan 2023 12:42:45 -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 6E32268BD5B; Wed, 11 Jan 2023 22:42:34 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 21FB968BCE7 for ; Wed, 11 Jan 2023 22:42:28 +0200 (EET) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 1F574FF809 for ; Wed, 11 Jan 2023 20:42:26 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 11 Jan 2023 21:42:17 +0100 Message-Id: <20230111204221.22550-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230111204221.22550-1-michael@niedermayer.cc> References: <20230111204221.22550-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/6] avcodec/utils: Ensure linesize for SVQ3 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: LAQ7nUia0ILQ Fixes: Assertion block_w * sizeof(uint8_t) <= ((buf_linesize) >= 0 ? (buf_linesize) : (-(buf_linesize)) Fixes: 54861/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SVQ3_fuzzer-5352418248622080 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/utils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 1aa0a05a31..30dea8a813 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -335,6 +335,9 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, // the next rounded up width is 32 *width = FFMAX(*width, 32); } + if (s->codec_id == AV_CODEC_ID_SVQ3) { + *width = FFMAX(*width, 32); + } for (i = 0; i < 4; i++) linesize_align[i] = STRIDE_ALIGN;