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 A013448E32 for ; Sun, 28 Apr 2024 21:41:30 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0268068D3FA; Mon, 29 Apr 2024 00:41:28 +0300 (EEST) Received: from w4.tutanota.de (w4.tutanota.de [81.3.6.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3FF3668D097 for ; Mon, 29 Apr 2024 00:41:21 +0300 (EEST) Received: from tutadb.w10.tutanota.de (unknown [192.168.1.10]) by w4.tutanota.de (Postfix) with ESMTP id DA865106019A for ; Sun, 28 Apr 2024 21:41:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1714340480; s=s1; d=lynne.ee; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:References:Sender; bh=GonRzIbbhiR5TDc88+fwkFw0E6a7ui0Weio/e3FKels=; b=aeyfz7ts1Qs99fRCYR8JvzBiUL0QzPrUGltMK+menI9jhIvN4s4KOaWbKZMsPBXv kCcg/boKS6vbET3CFiGJqWhpvxRtLvWYOgPptjzZ4b4fu08tL1ngcZvz0p68aWedABh 0ldUnM1hQ7qapZTr0lIstYwdjd/8HGnk90VnisPxjEGOdoSEhgzuNcqksMuWcVFXhoV jKd83A8evjCU7JEQYXP/NWC21Tu39DayMSIp1gJ/nS9IHK1b//sbjKoO6bhJKkbxUSg iH7BBg5/mLpah2TOO2NiohOsS0TzDCTHKOVcBRPMAhpO+4gn/u3SIkfpJ1uy5QdFMUM 429yI9FjGA== Date: Sun, 28 Apr 2024 23:41:20 +0200 (CEST) From: Lynne To: FFmpeg development discussions and patches Message-ID: In-Reply-To: <20240428213052.3800493-2-michael@niedermayer.cc> References: <20240428213052.3800493-1-michael@niedermayer.cc> <20240428213052.3800493-2-michael@niedermayer.cc> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 2/5] avcodec/aaccoder: assert that escape case len is not causing issues 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Apr 28, 2024, 23:31 by michael@niedermayer.cc: > Inspired by CID1465483 Unintentional integer overflow > > Sponsored-by: Sovereign Tech Fund > Signed-off-by: Michael Niedermayer > --- > libavcodec/aaccoder.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c > index 4ce54ca8867..6e5817e237b 100644 > --- a/libavcodec/aaccoder.c > +++ b/libavcodec/aaccoder.c > @@ -178,6 +178,8 @@ static av_always_inline float quantize_and_encode_band_cost_template( > int coef = av_clip_uintp2(quant(fabsf(in[i+j]), Q, ROUNDING), 13); > int len = av_log2(coef); > > + av_assert2(len >= 4); > + > put_bits(pb, len - 4 + 1, (1 << (len - 4 + 1)) - 2); > put_sbits(pb, len, coef); > } > I'm not sure that's correct to do. Any specific cases where this happens? _______________________________________________ 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".