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 219074DDFC for ; Tue, 4 Mar 2025 15:30:06 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1A7FE68EE21; Tue, 4 Mar 2025 17:30:04 +0200 (EET) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A16EA68E860 for ; Tue, 4 Mar 2025 17:29:56 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id E9B62442D9 for ; Tue, 4 Mar 2025 15:29:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1741102196; 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=d6B4uX1GqRBJ4QFJa+YX4bKNtBBLxG9TYQYBU4r0ce8=; b=GsR7ePcU+6xD8dSkRHoOvHvuSEraSq0zJ/SDdNFefxGa7IKbRfP+ldQ+9HPL6+OR9vETZK HdMmEyp0qiX7EMKsfw/muVU//T+P664soaK2ELnwZOAfYer3nzYm1J2QTmDyWoOAHuHDL4 Ba9gTyr0nTnjD/fwHYcvCD3jnBfv0QqPVY+eOMMha9CBsrYVQ3wDljbLkXUxcPVgcwtHrK WIkeZkhJv7e0IZKSdxPhosSQoCK7zy12OD8PQ/1TDkLOmlFTRe8rpkW7hv+yBHPpOjYZDb qmxCsgkJj874OjHSgrIqlVHsZpQL9iGgLXQNJlkDxeFQ6+GZm0c3NA5brJevUw== Date: Tue, 4 Mar 2025 16:29:54 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20250304152954.GM4991@pb2> References: <20250203042458.1863121-1-viraajraulgkar@gmail.com> <20250203042458.1863121-2-viraajraulgkar@gmail.com> MIME-Version: 1.0 In-Reply-To: <20250203042458.1863121-2-viraajraulgkar@gmail.com> X-GND-State: clean X-GND-Score: -70 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddutddvgedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculdeftddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfpihgvuggvrhhmrgihvghruceomhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtqeenucggtffrrghtthgvrhhnpeeigeektdejudffjefhteegjedtgeettefggedthfejgfevhfetgeekjedtvdfhveenucfkphepgedurdeiiedrieejrdduudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepgedurdeiiedrieejrdduudefpdhhvghloheplhhotggrlhhhohhsthdpmhgrihhlfhhrohhmpehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgdpnhgspghrtghpthhtohepuddprhgtphhtthhopehffhhmphgvghdquggvvhgvlhesfhhfmhhpvghgrdhorhhg X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH v5 2/2] avformat/riffdec: warn on invalid sample rate 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="===============0830732417868292347==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============0830732417868292347== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="GLkkhArJ78NXFBx2" Content-Disposition: inline --GLkkhArJ78NXFBx2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 03, 2025 at 09:54:58AM +0530, Viraaj Raulgaonkar wrote: > If strict_std_compliance < FF_COMPLIANCE_STRICT, warn the user of the > invalid sample rate instead of returning an error. In certain cases the > sample rate can get decoded later on. >=20 > Fixes Trac Ticket #11361. > --- > libavformat/riffdec.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/libavformat/riffdec.c b/libavformat/riffdec.c > index 2b269b1682..a3eee43a41 100644 > --- a/libavformat/riffdec.c > +++ b/libavformat/riffdec.c > @@ -180,9 +180,12 @@ int ff_get_wav_header(AVFormatContext *s, AVIOContex= t *pb, > par->bit_rate =3D bitrate; > =20 > if (par->sample_rate <=3D 0) { > - av_log(s, AV_LOG_ERROR, > + int strict =3D s->strict_std_compliance >=3D FF_COMPLIANCE_STRIC= T; > + av_log(s, strict ? AV_LOG_ERROR : AV_LOG_WARNING, > "Invalid sample rate: %d\n", par->sample_rate); > - return AVERROR_INVALIDDATA; > + if (strict) > + return AVERROR_INVALIDDATA; The specification uses a DWORD, which is unsigned, so strict_std_compliance is not strictly correct as teh specification allows values that fall outside int32_t its libavformat that doesnt suppport that thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Dictatorship: All citizens are under surveillance, all their steps and actions recorded, for the politicians to enforce control. Democracy: All politicians are under surveillance, all their steps and actions recorded, for the citizens to enforce control. --GLkkhArJ78NXFBx2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZ8cccgAKCRBhHseHBAsP qwatAKCEf80gk0y6T7T6pNaUXhXjuOW4JACcCNVOmegrPci8K+D/CpjJ0PY7qhc= =Ml3Z -----END PGP SIGNATURE----- --GLkkhArJ78NXFBx2-- --===============0830732417868292347== 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". --===============0830732417868292347==--