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 ESMTP id 9C2F74A417
	for <ffmpegdev@gitmailbox.com>; Wed, 27 Mar 2024 20:56:21 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 51A1968D682;
	Wed, 27 Mar 2024 22:56:19 +0200 (EET)
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 D858868D225
 for <ffmpeg-devel@ffmpeg.org>; Wed, 27 Mar 2024 22:56:12 +0200 (EET)
Received: by mail.gandi.net (Postfix) with ESMTPSA id 38B8E60002
 for <ffmpeg-devel@ffmpeg.org>; Wed, 27 Mar 2024 20:56:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc;
 s=gm1; t=1711572972;
 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=JJB9ecpQk8NDNiRur0FU3AmcOH3HCn5i/9TDDrPfkJg=;
 b=iJojjqFLCfPNjc0ecJ7VzMyg7/U/OoCKC6967KcGo4WMKIyGVKLOqAv7jRcfJQHLmgZ8Hh
 AXVMpKQSK3msZsDjBwU/6R56uL6vzSelosVNs6cxVEh/0otkW9ftNMtecsbPeCnV4y06fb
 vZ9LpwU9oKMES4SiR8WlyJjidRB2GM1Y9GxEKnJqhqcoIIsvLd5x+WZpdRfYnlFm2qR8TA
 LBQ3QzeB848CxxEWdvwjuNzr2nuxskQhz7AxFWGrX9H6oKgH5fz4QQZ5PlV+XR6wXAQI4H
 KReEAeD27eqByNWSxQ7txcAyR+hWIndaxSPotyH5/j/NOWYFffLVJWO3L5e8XQ==
Date: Wed, 27 Mar 2024 21:56:11 +0100
From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Message-ID: <20240327205611.GJ6420@pb2>
References: <20240326001151.12083-1-michael@niedermayer.cc>
 <20240326001151.12083-7-michael@niedermayer.cc>
 <171153255139.7287.15957090514738342143@lain.khirnov.net>
MIME-Version: 1.0
In-Reply-To: <171153255139.7287.15957090514738342143@lain.khirnov.net>
X-GND-Sasl: michael@niedermayer.cc
Subject: Re: [FFmpeg-devel] [PATCH 07/10] avformat/wavdec: sanity check
 channels and bps before using them for block_align
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="===============4240693044712657501=="
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/20240327205611.GJ6420@pb2/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>


--===============4240693044712657501==
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="lCdAXWBhB9DfeGxY"
Content-Disposition: inline


--lCdAXWBhB9DfeGxY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Mar 27, 2024 at 10:42:31AM +0100, Anton Khirnov wrote:
> Quoting Michael Niedermayer (2024-03-26 01:11:48)
> > Fixes: 62276/clusterfuzz-testcase-minimized-ffmpeg_dem_W64_fuzzer-47040=
44498944000
> > Fixes: signed integer overflow: 520464 * 8224 cannot be represented in =
type 'int'
> >=20
> > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz=
/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavformat/wavdec.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >=20
> > diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
> > index 668c8adc36b..89855670d9c 100644
> > --- a/libavformat/wavdec.c
> > +++ b/libavformat/wavdec.c
> > @@ -34,6 +34,7 @@
> >  #include "libavutil/log.h"
> >  #include "libavutil/mathematics.h"
> >  #include "libavutil/opt.h"
> > +#include "libavcodec/internal.h"
> >  #include "avformat.h"
> >  #include "avio.h"
> >  #include "avio_internal.h"
> > @@ -908,7 +909,9 @@ static int w64_read_header(AVFormatContext *s)
> >              if (ret < 0)
> >                  return ret;
> >              avio_skip(pb, FFALIGN(size, INT64_C(8)) - size);
> > -            if (st->codecpar->block_align) {
> > +            if (st->codecpar->block_align &&
> > +                st->codecpar->ch_layout.nb_channels < FF_SANE_NB_CHANN=
ELS &&
>=20
> I objected to this approach.

Maybe that was your intend but what you actually wrote and what i understood
was that you objected to adding a field to AVFormatContext
For reference:

    > is anyone against adding a max_channels field to AVFormatContext  or =
something
    > like that ?

    I am.

[...]

--=20
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is a danger to trust the dream we wish for rather than
the science we have, -- Dr. Kenneth Brown

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

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

iFwEABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZgSH5wAKCRBhHseHBAsP
q5aaAJ9DRgL2DhYhMeyKHg+BAEwziHhtcACTBF/WbbgVqF9LdbrUGhqIW01+GA==
=saaG
-----END PGP SIGNATURE-----

--lCdAXWBhB9DfeGxY--

--===============4240693044712657501==
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".

--===============4240693044712657501==--