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 ESMTP id 4BCBA426CD for ; Thu, 6 Jan 2022 09:32:12 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1BDFB68A9AD; Thu, 6 Jan 2022 11:32:10 +0200 (EET) Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [217.70.178.232]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2A6356807A1 for ; Thu, 6 Jan 2022 11:32:04 +0200 (EET) Received: from localhost (213-47-68-29.cable.dynamic.surfer.at [213.47.68.29]) (Authenticated sender: michael@niedermayer.cc) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 391CF20000E for ; Thu, 6 Jan 2022 09:32:03 +0000 (UTC) Date: Thu, 6 Jan 2022 10:32:02 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220106093202.GZ2829255@pb2> References: MIME-Version: 1.0 In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH 2/3] avcodec/mlpdec: Use get_bits() instead of get_bits_long() when possible 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="===============3379974390457048349==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============3379974390457048349== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Nj2Lb3ghs26sjE/Y" Content-Disposition: inline --Nj2Lb3ghs26sjE/Y Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 05, 2022 at 10:38:34PM +0100, Andreas Rheinhardt wrote: > huff_lsbs is guaranteed to be in the range of 0..24 and > so is lsb_bits here, so one can use get_bits(). >=20 > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/mlpdec.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c > index 29fac54542..61b9a641dd 100644 > --- a/libavcodec/mlpdec.c > +++ b/libavcodec/mlpdec.c > @@ -268,7 +268,7 @@ static inline int read_huff_channels(MLPDecodeContext= *m, GetBitContext *gbp, > return AVERROR_INVALIDDATA; > =20 > if (lsb_bits > 0) > - result =3D (result << lsb_bits) + get_bits_long(gbp, lsb_bit= s); > + result =3D (result << lsb_bits) + get_bits(gbp, lsb_bits); > =20 > result +=3D cp->sign_huff_offset; > result *=3D 1 << quant_step_size; This seems not to fully work Assertion n>0 && n<=3D25 failed at libavcodec/get_bits.h:403 lsb_bits and cp->huff_lsbs are 31 in this failure, it seems the checks that prevent this are conditional but i didnt debug/check this any further thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Observe your enemies, for they first find out your faults. -- Antisthenes --Nj2Lb3ghs26sjE/Y Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYda3DgAKCRBhHseHBAsP q08AAKCDsrH4N9bxNXtvkdCUeTvov8sO4gCeINUqH1IkoR2DYjqMmfBPCVw9m7Q= =lqjl -----END PGP SIGNATURE----- --Nj2Lb3ghs26sjE/Y-- --===============3379974390457048349== 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". --===============3379974390457048349==--