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 E101148DBC for ; Fri, 26 Jan 2024 21:47:14 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C679568CF69; Fri, 26 Jan 2024 23:47:01 +0200 (EET) 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 1D27E68C4F1 for ; Fri, 26 Jan 2024 23:46:54 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id 71A21C0002 for ; Fri, 26 Jan 2024 21:46:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1706305613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:in-reply-to:in-reply-to:references:references; bh=VVDuji76/Jy8t2oRY4XD4wzZsXfl7QXaXtvquFUqWZo=; b=Uj9Fyr10qLsruG3DLBmLI6ZT5OOaUBORBymME89h4SkUTBE9LQXulyy2Fyz6vYWe5gsn3i 0whQ5EtgpnJ55CLCc+JJ2S47+E3HBJPUROiR7gLg889gEZXnod3CkD/MLnIH6fCgu3sukH m89jAv9xbXkdCi2WqHmXP5kFyu0SqC9951WgdhFNK3XXMzF3Z1oN8Kc440O5Z6HWqYx2GN pmwZs96yln0aPRq8zc8O5sKRrJDVyWqZF8FffBrxJ1iMwiFAR0go3IxQldaI+OvMlWoAfr YTHCMdJCxYB2nAAj/wA+ava40nTEXqT2qsC6tOCaq2REhhIBx7g5Hwf5v7NQJw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 26 Jan 2024 22:46:50 +0100 Message-Id: <20240126214651.22783-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240126214651.22783-1-michael@niedermayer.cc> References: <20240126214651.22783-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 2/3] avcodec/cbs_h266_syntax_template: sanity check num_multi_layer_olss 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 MIME-Version: 1.0 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: It is not possible to encode a index into an empty list. Thus this must be invalid at this point or before. Its likely a broader earlier check can be used here, someone knowing VVC should look at that. Its not immedeatly obvious from the spec by looking for numlayerolss Fixes: out of array access Fixes: 65160/clusterfuzz-testcase-minimized-ffmpeg_BSF_VVC_METADATA_fuzzer-4665241535119360 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/cbs_h266_syntax_template.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c index 549d0212119..9e479c9c314 100644 --- a/libavcodec/cbs_h266_syntax_template.c +++ b/libavcodec/cbs_h266_syntax_template.c @@ -946,6 +946,8 @@ static int FUNC(vps) (CodedBitstreamContext *ctx, RWContext *rw, if (!current->vps_each_layer_is_an_ols_flag) { uint16_t vps_num_dpb_params; + if (!num_multi_layer_olss) + return AVERROR_INVALIDDATA; ue(vps_num_dpb_params_minus1, 0, num_multi_layer_olss - 1); if (current->vps_each_layer_is_an_ols_flag) vps_num_dpb_params = 0; -- 2.17.1 _______________________________________________ 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".