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 D6880469E8 for ; Sun, 28 Apr 2024 21:31:12 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D92F768D406; Mon, 29 Apr 2024 00:31:02 +0300 (EEST) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4A26068D3E4 for ; Mon, 29 Apr 2024 00:30:55 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 93888C0006 for ; Sun, 28 Apr 2024 21:30:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714339854; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=agRXQzJUotCv/NiUmDl2wa0lty4elzS75CdWVP9XSDc=; b=A18LsvkApSfLz1rjzxtAOM0QolOAXIOmlLtobD5wL8J8WZpXkpdVdnlX4tzaMgwft02YAV DJT2PCaNpFzUrELYLbLurmc6eLc3joG73g+IdsSmRuTwtF20FvitXVNAyuJWi7tn01dhnN hxcPfjczNcT0GYLbNlqZaytPfn16SXluWMmFM2XUul9flI60qQoEaEHuFpeg4kpxudC4GQ 2S9EmP7ZaPbrda1V1hQS01qSNb949lg8d4U0iXYJRiTxx0VbL9ztNn27UHR3f9IY2+lPiJ IQj49GBDiiSIzef+7fmPlzWgUZ6Y2Bg3thw5XkOuhAFbLYWtjqF2LH1gUK48rQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 28 Apr 2024 23:30:49 +0200 Message-ID: <20240428213052.3800493-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240428213052.3800493-1-michael@niedermayer.cc> References: <20240428213052.3800493-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [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: 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); } -- 2.43.2 _______________________________________________ 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".