From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id C3F114CAB0 for ; Sat, 25 Jan 2025 01:26:39 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 10B7568A542; Sat, 25 Jan 2025 03:26:36 +0200 (EET) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7E29168A542 for ; Sat, 25 Jan 2025 03:26:29 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id BAEF420002 for ; Sat, 25 Jan 2025 01:26:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1737768388; 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=S/yyBh71lSZ2gUWzahp3nzu+ZRC5vCk/20jezUuDWcY=; b=npQpTah9AimnNw7mbRQcWABkTE5Q5lF9og5mRs769RPp3d57Akh7LrttdtggwyPMGa9K9X tcROpPfD7hyZ3w5m3ZbASD1olnz1dFsX+sP0CKR2tYGpVir+Ga1D+cZ2GyQbleX4ziewBt mpFU0Cju15YpaRV59IaCqNiLncHpUuzsc7gvQATcB7g0PUf2B44+Z5NddpS45RgPIbKR0J i4hApltvpczek+mUzJY1OkvhxWfphInM+jzz1oeeYNxeaw2gdY/g7iNAE0HjBees6Hp8td rAjCHSPkKmSxWAZW0rAbmPki6WAcb3Cmcf9otYl6aC0b1o3NDk98VlM16ts3yg== Date: Sat, 25 Jan 2025 02:26:27 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20250125012627.GH4991@pb2> References: <20250121120005.509005-1-viraajraulgkar@gmail.com> <20250125011952.GG4991@pb2> MIME-Version: 1.0 In-Reply-To: <20250125011952.GG4991@pb2> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH] avformat/riffdec: remove invalid sample rate check 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 Content-Type: multipart/mixed; boundary="===============7015461121172542303==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============7015461121172542303== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="v8e++R6RGuohT3A+" Content-Disposition: inline --v8e++R6RGuohT3A+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jan 25, 2025 at 02:19:52AM +0100, Michael Niedermayer wrote: > Hi >=20 > On Tue, Jan 21, 2025 at 05:30:05PM +0530, Viraaj Raulgaonkar wrote: > > Sample rates up to 2^31 - 1 are considered valid, while greater values > > are invalid. Removing the check potentially allows the sample rate > > to be decoded in all cases instead of halting demux for values > > greater than 2^31 - 1. > >=20 > > Fixes Trac ticket #11361. > > --- > > libavformat/riffdec.c | 5 ----- > > 1 file changed, 5 deletions(-) > >=20 > > diff --git a/libavformat/riffdec.c b/libavformat/riffdec.c > > index b7a85a6ab2..94dccb324e 100644 > > --- a/libavformat/riffdec.c > > +++ b/libavformat/riffdec.c > > @@ -179,11 +179,6 @@ int ff_get_wav_header(void *logctx, AVIOContext *p= b, > > =20 > > par->bit_rate =3D bitrate; > > =20 > > - if (par->sample_rate <=3D 0) { > > - av_log(logctx, AV_LOG_ERROR, > > - "Invalid sample rate: %d\n", par->sample_rate); > > - return AVERROR_INVALIDDATA; > > - } >=20 > the API does not really allow negative sample rates If you want to export the stored sample rate value correctly, this would need a API change (which is a alot of work and seems not justified here) Otherwise, simply print a warning and return sample_rate/2 instead (assuming that works, does it work ?) thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Some people wanted to paint the bikeshed green, some blue and some pink. People argued and fought, when they finally agreed, only rust was left. --v8e++R6RGuohT3A+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZ5Q9wwAKCRBhHseHBAsP q61sAJ9zTDmaWUq714TjE2gBHnrFagX39gCfWGD8p+Rz9EXmAmZbxvsAXCVxDD8= =XBgR -----END PGP SIGNATURE----- --v8e++R6RGuohT3A+-- --===============7015461121172542303== 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". --===============7015461121172542303==--