From patchwork Sat Feb 17 17:09:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 46305 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:dda5:b0:19e:cdac:8cce with SMTP id kw37csp399080pzb; Sat, 17 Feb 2024 09:10:01 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVj946AEQ+LD78tC1yLkRtUzB2UjTntXMpVUoIpd/LQL90QHyUeR84ugVFsZXAEfv/OkfrLxiHRURdptnyUtd/Rw+Fa02svObphcA== X-Google-Smtp-Source: AGHT+IHoAO9393kZX4uyvOS2+pDjzF7FQMqlY/4eAoL6KEKiRF4QJ4W1gz0GYrN6YmDHbH70QCWS X-Received: by 2002:a05:6512:94e:b0:511:8631:47ce with SMTP id u14-20020a056512094e00b00511863147cemr4970131lft.7.1708189801124; Sat, 17 Feb 2024 09:10:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708189801; cv=none; d=google.com; s=arc-20160816; b=HUg4efyJND9hqiXSfI0hcQPgTzap7g50blC5tsfmc8kHEp+rBfoK2ua6S4HtXTYgCd AIeUHmyKvN3A6BeNmDMxHPFw8mWsuCG5FT1TrbwoWera7pICIIWfCfbXHXYnzsC/ulQy UVP6BmE7vVSxaL5w+3cyA/aFE7s9x55hzQh0I2NNFiq97RiKDZ50vnfhMg7KaiQCOmri SmWsStXG810bPv3Kdd21c2Mo/rE3qUficSuwVhIqIXCEL3Rm7DDFkwrDn9Q7MFsK8Rli eQw0K8fp4yFRaR7mTd/lPNS3AJ0t0iJ2Ywy78x8hrZe2pmWcsdXOvxc3cuA3HYYZDrNf 0fqQ== 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:dkim-signature :delivered-to; bh=bR5IpFJa/MIj7vlrTfr/8JzBXUWn8Yxfx2jX9/SvAvQ=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=Asn63JVaW+vDTI3GcVFGvuAsF7vEsAUpxuBILILUuW+Okdldsv6kufOpDAWrDBX8SP m92KRKpQ6YNv5Fo27AwEzeVsJuU/QgmYM+pZ3LWJ4NnCA9/LMOJda0LdLF7tyZyiU1R7 Gfld2me45JUdNu9ZL3THiHCbcSJfPShuPP9PJyYaoNK+d+WJib5Rf1RuomD+2vlLtsRf Xwrn57blXVva6BXL8GwPSbVL4IroLXvqH+74XXMPTbQLcxjDSwsMGcpm3ERdhKTfkoUe y4ZV0wQoTq6LlNkQNd1sC1YzuQcPd1OydwwckbfRZ6nhHAhVPi4//jZi/5Shz+OdeGAT LBDA==; 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=OoLZ6xGX; 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 lz15-20020a170906fb0f00b00a3e4f7071casi167501ejb.686.2024.02.17.09.10.00; Sat, 17 Feb 2024 09:10: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; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=OoLZ6xGX; 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 855ED68D2D1; Sat, 17 Feb 2024 19:09:56 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BEBF168D1E5 for ; Sat, 17 Feb 2024 19:09:49 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id 52EFC60004 for ; Sat, 17 Feb 2024 17:09:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1708189788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc; bh=tL5oExu0Iw5Bn45M/ryRem0reLw76IgGxPfgUkckCrQ=; b=OoLZ6xGXqyWQYTKsCPcl9ItWQmcOoe0NVDS0HBWFRxEpqf6zRjYI82NlB+U/X1CA8s379u k4UXppECVdyi4pUIQOo78AgIu4VMq6yxRC6CvreXfX5GuduVaP47t/A9Uiell4ZuUXI52l QhJwyxqINzPxwGOrnFC0P1Tp579qq99JA72nKwt807KuEgrXh3Rig0gnYFqIXKWdlF30nT ZvFM09T0OJYE8Hr/7YTRNMuVP8WJsPmX8kPkMeP8BtLipJkOlunkbiqyU6eX1UE+GJIQm3 HHyDta2LZmgktWTdZyxcDHQ+/3br3+92oG8IIDSNW2/+KS+0DmWyccY2/RkOAQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 17 Feb 2024 18:09:46 +0100 Message-Id: <20240217170947.25351-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 1/2] swscale/utils: Allocate more dithererror 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: 4+QBl0wYvBrs Fixes: out of array read Signed-off-by: Michael Niedermayer --- libswscale/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/utils.c b/libswscale/utils.c index ec822ff5d92..4dc0fbfefbf 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -1885,7 +1885,7 @@ static av_cold int sws_init_single_context(SwsContext *c, SwsFilter *srcFilter, } for (i = 0; i < 4; i++) - if (!FF_ALLOCZ_TYPED_ARRAY(c->dither_error[i], c->dstW + 2)) + if (!FF_ALLOCZ_TYPED_ARRAY(c->dither_error[i], c->dstW + 3)) goto nomem; c->needAlpha = (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat) && isALPHA(c->dstFormat)) ? 1 : 0;