From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTPS id 2F3A54D089
	for <ffmpegdev@gitmailbox.com>; Thu, 17 Apr 2025 00:14:22 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3774468A467;
	Thu, 17 Apr 2025 03:14:18 +0300 (EEST)
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 76A57687CAC
 for <ffmpeg-devel@ffmpeg.org>; Thu, 17 Apr 2025 03:14:11 +0300 (EEST)
Received: by mail.gandi.net (Postfix) with ESMTPSA id CB15C43972
 for <ffmpeg-devel@ffmpeg.org>; Thu, 17 Apr 2025 00:14:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc;
 s=gm1; t=1744848851;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=k/RzA8xpHMq0uzXnbHr8b6/1bVx0SIyrMqzWDeBymqw=;
 b=RiFVgeCtmRYFfObl5Q1n/CI/6TJKuo2VCac5sK11aigQ5OcRVZQtp5dApZfeA/BWmyjT8v
 ++/919jhmUoUajBZJHDe9Nt2bIqxkPOaq8TGswWAvWc6/AdqlbWY3TDxP5abJ1MC6DGRWW
 Zc33mUPQ8kFrmREUNGVYkaYrUNCwclDdJy+CehLnpe158c1GC0/y4x+ITW1TitLNzFrDVY
 qOD5BUVhCNdz+btK6QJDB2USW5PIv3k2HGh/eUq+nP7eM+ENveqw2FbzleqAWF783/4utn
 I8zKq+Gp3UffceMalk7rPi8bprwWjM9YKdUgxHsiXSzwi6yx9vn0Knmdj7wRFA==
Date: Thu, 17 Apr 2025 02:14:09 +0200
From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Message-ID: <20250417001409.GR4991@pb2>
References: <GV1P250MB0737BA9573ABC00B1B8FF6448FBD2@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM>
MIME-Version: 1.0
In-Reply-To: <GV1P250MB0737BA9573ABC00B1B8FF6448FBD2@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM>
X-GND-State: clean
X-GND-Score: -85
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvvdejjeekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculdduhedmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttdejnecuhfhrohhmpefoihgthhgrvghlucfpihgvuggvrhhmrgihvghruceomhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtqeenucggtffrrghtthgvrhhnpeelkeeggfffiedufeejueffjeduhedttdduledtheevveevtdeiueelhfdtuedtkeenucfkphepgedurdeiiedrieejrdduudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepgedurdeiiedrieejrdduudefpdhhvghloheplhhotggrlhhhohhsthdpmhgrihhlfhhrohhmpehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgdpnhgspghrtghpthhtohepuddprhgtphhtthhopehffhhmphgvghdquggvvhgvlhesfhhfmhhpvghgrdhorhhg
X-GND-Sasl: michael@niedermayer.cc
Subject: Re: [FFmpeg-devel] [PATCH 1/2] avcodec/dvbsubenc: Sanity check
 num_rects
X-BeenThere: ffmpeg-devel@ffmpeg.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Content-Type: multipart/mixed; boundary="===============7388747117032208409=="
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/20250417001409.GR4991@pb2/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>


--===============7388747117032208409==
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="yAluYXoT4TZdXexl"
Content-Disposition: inline


--yAluYXoT4TZdXexl
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Apr 16, 2025 at 11:17:30AM +0200, Andreas Rheinhardt wrote:
> Patches attached.
>=20
> - Andreas

>  dvbsubenc.c |    3 +++
>  1 file changed, 3 insertions(+)
> 27ce315dbaee02f8c92c12f8c9cd0c8c7edc54fb  0001-avcodec-dvbsubenc-Sanity-c=
heck-num_rects.patch
> From b3a4381000d13ac344114dd5f0230c9eae7b32aa Mon Sep 17 00:00:00 2001
> From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> Date: Wed, 16 Apr 2025 10:23:01 +0200
> Subject: [PATCH 1/2] avcodec/dvbsubenc: Sanity check num_rects
> MIME-Version: 1.0
> Content-Type: text/plain; charset=3DUTF-8
> Content-Transfer-Encoding: 8bit
>=20
> It is written as region_id which is a single byte.
> Also fixes a potential (defined) overflow in the num_rects * 6
> multiplication later; this has been found by =EA=B9=80=EC=8A=B9=ED=98=B8 =
<kimsho98@naver.com>.
>=20
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/dvbsubenc.c | 3 +++
>  1 file changed, 3 insertions(+)
>=20
> diff --git a/libavcodec/dvbsubenc.c b/libavcodec/dvbsubenc.c
> index 822e3a5309..8eeac76855 100644
> --- a/libavcodec/dvbsubenc.c
> +++ b/libavcodec/dvbsubenc.c
> @@ -284,6 +284,9 @@ static int dvbsub_encode(AVCodecContext *avctx, uint8=
_t *outbuf, int buf_size,
>      if (h->num_rects && !h->rects)
>          return AVERROR(EINVAL);
> =20
> +    if (h->num_rects >=3D 256)
> +        return AVERROR_INVALIDDATA;

should this not be AVERROR(EINVAL); ?

thx

[...]

--=20
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire

--yAluYXoT4TZdXexl
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCaABHygAKCRBhHseHBAsP
qwxTAJ4lvBhatHQDi3CIcVe5Xf+6F4ke3gCeJKsFwIvx4PxagkKYF3qGDHYnqGE=
=03Zr
-----END PGP SIGNATURE-----

--yAluYXoT4TZdXexl--

--===============7388747117032208409==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

--===============7388747117032208409==--