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 2811D4B372 for ; Fri, 5 Jul 2024 00:22:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 20CF368DAF3; Fri, 5 Jul 2024 03:22:17 +0300 (EEST) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 469FC68D9FF for ; Fri, 5 Jul 2024 03:22:01 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 8535C40002 for ; Fri, 5 Jul 2024 00:22:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1720138920; 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=F3vdqrVaD4mtno25xXlzQ+1kt0JflLe7X1a1OwjpQA8=; b=VSOoN6hiPFhhTC47U8yAGqa4uxYPD26EfVwwhikFJ0jM2QakRPqiUioI3OOQefGhu5HOJ8 QfKoN/wjCA9XD/oyLFXRnCDSrx6V0tME2n5KdJPBEg+yvLf7DzO5pIQ8PR58VFXWc0dANw Pm/cPCC2P3Tbmb9UVaCt/FKNSNscwFkI5hsUVYJieuE7+BYs77z8L5BU29slK1kxsYDpqO vNKVwR16sP9IlKnZ6GQxgcJddSL6fzqfW9A0g3UQo1QhGq5o2URnpkTYZqH3ILymhQtBEa hoDE7HypcW0NxxiSItEvJIUBNcbAu/8aXL2WShdqEWyqH7iHsyt2p+EfGvXxwQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 5 Jul 2024 02:21:46 +0200 Message-ID: <20240705002156.1964272-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240705002156.1964272-1-michael@niedermayer.cc> References: <20240705002156.1964272-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 05/15] avcodec/golomb: Assert that k is in the supported range for get_ur/sr_golomb() 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: Found by code review related to CID1604563 Overflowed return value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/golomb.h | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h index 9f60fe03976..742334978d5 100644 --- a/libavcodec/golomb.h +++ b/libavcodec/golomb.h @@ -402,6 +402,7 @@ static inline int get_ur_golomb(GetBitContext *gb, int k, int limit, log = av_log2(buf); if (log > 31 - limit) { + av_assert2(log >= k); buf >>= log - k; buf += (30U - log) << k; LAST_SKIP_BITS(re, gb, 32 + k - log); -- 2.45.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".