From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 471334CE36 for ; Tue, 30 Dec 2025 23:09:58 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'4hV0gsTOQXo1/1EUIkJeK4FadWCiJwz5NTRrNKAix/A=', expected b'wiFXm27m4WeB/CEkT2P49mPzONx+PtXKCFIJg4vWQ9U=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1767136188; h=mime-version : to : date : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=4hV0gsTOQXo1/1EUIkJeK4FadWCiJwz5NTRrNKAix/A=; b=ImtLWXbh5Oq6gGXAma8UKrh3hf/fH5tc98uko37+CjTlwub0FKCX/jfRc5I37Ig5GIDQ8 2NERvjTwlOgM95cu5FtjRdL5RUpQv1gVlLiamU3O/QuuKFeurKliGaEGd/HWs6NZohSR4Qs zCJvnJ/rxtDZj/OD9wEwV0nTYVJCZFuYGyuw9D5p0IUzJsrA1T5mIMX7DJEaq2Jh2Ca9WFQ 1SpqWF9oc9EB3hRBkn80pXTsHYDZO87L8HnbmR0C6a3A3fsAbABpH/+5Mc8E+mBv2+9x+cM HtHEdDcxFILDD4NXnwJH3yKcvS8BnGM70MAN2gUcsPHrh8MAEueeNgchci7A== Received: from [172.20.0.4] (unknown [172.20.0.4]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id AB21C690C82; Wed, 31 Dec 2025 01:09:48 +0200 (EET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1767136170; b=GYVEb3tWsxGqi/GEMJzEeP7X/uLdt+nXGwHacHcmP+ePpNW8Buy/IIJJQuZohfV0KgjiX l3qXLVe25+wfupfHvkA6jNFBen2zN8lWhSN+O2VZekh7TnNDXxHK4fnYc8MjmtvsFYv8iBl bdIHWsW4jiw40/ybNUyQvvGNm/Cv6AsYG1gjg1SSeTqkdOQXuBifqezQasV/3QEoqO4F6+R o+zJaoH/O27U5jcTVgoFBLG2IpUu4nZwfc8ZkkXQdzeGljkV/V+uGVEsIU06YQrvgr8KiEr yjl2L0MYPm0chojhGOpI1Rnrjtx3D1f0cgJ1CXZ7GIYMIUJrec1/OSFOzh8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1767136170; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=5VQuIWB/xoTMmpwNt6PknLZmm2+/nQKWWWskwSfgPMA=; b=GMcsNWGH8iq0rXi4QPliIZrTzBm6X/TmKmvKkv6+37CiKPuQPgE4vaiyts2NtuULOt7mL BPdsWwxOHEz6IamVtqdWfP89AhGUTVTv2KAxboewcI6cHdBIfQe8hI/rYzaU8qdnCPVdObx bXiHaHuCQfi0ulTqoB23//A2y8d2CMoQnEvuM0Ds23YrXW48XIywZW7InjFc2tx50kvVGjQ f+goZ/nEfuWvYozjhWgItsMgAWnp9KcdgYQHBQNo2R+UV4jDEtE082sBNHirziaUWoRj4ao ii2klOriZBpnRoPP/AK+Fn6FM8PFSFp5/8Urd6EP0353RCzEAEIKqjZnBs6g== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=pass header.from=ffmpeg.org policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=ffmpeg.org policy.dmarc=quarantine DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1767136162; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=wiFXm27m4WeB/CEkT2P49mPzONx+PtXKCFIJg4vWQ9U=; b=eWihnhEYqZAtDRZ+8AoXTD69FDG7lkOd1ct9GYJA76fs/myraIqV7LG21lAUAdDt9wxw+ YJyk7xAzme0rU68gnpqJdJRLcpF2Gui/bbPyw2xJM6bXKIkYmTlNBYkxktJRw9sQn2Z/qUM 6O7C63v33A7ErbPNTwsHe6qPJUZRZFvz1b9xByfHv0QCSKWevSv22qu3TWRfObhasS2ypHu C6CEZuQR5vpAwChCWeQEacM/Sc5sV7pBeSsQ2N6TZOXaxEBQcwqEYgXXOGQZoWi0RXQZHzL EJMfqz9HOZzjT2CJPSvN0zmx5GuU7I9mxHL9GgVYyrQBzjYfwTqeYpqcjKyQ== Received: from de3a2b3407a2 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id AD402690AD4 for ; Wed, 31 Dec 2025 01:09:22 +0200 (EET) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Tue, 30 Dec 2025 23:09:22 -0000 Message-ID: <176713616281.25.3506354744579976696@4457048688e7> Message-ID-Hash: KHOUVV2MPYQJKRN4LICZJQARTICQ7YOY X-Message-ID-Hash: KHOUVV2MPYQJKRN4LICZJQARTICQ7YOY X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PR] [8.0] Backport VVC fixes (PR #21329) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: frankplow via ffmpeg-devel Cc: frankplow Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #21329 opened by frankplow URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21329 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21329.patch Backport fixes from #21293 and #21317. >>From b0f76db8660bb6925e2bc4348d0e8f017fa61c55 Mon Sep 17 00:00:00 2001 From: Frank Plowman Date: Wed, 24 Dec 2025 15:35:06 +0000 Subject: [PATCH 1/2] lavc/vvc: Error on inter slice with no reference pics The semantics of sh_num_ref_idx_active_minus1[ i ] state that When the current slice is a P slice, the value of NumRefIdxActive[ 0 ] shall be greater than 0. When the current slice is a B slice, both NumRefIdxActive[ 0 ] and NumRefIdxActive[ 1 ] shall be greater than 0. Fixes: use of uninitialized memory Fixes: 449549597/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-5600497089445888 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reported-by: Michael Niedermayer michael@niedermayer.cc (cherry picked from commit 90f1f797aa9231375e4858df523fbfeda89bfd79) --- libavcodec/cbs_h266_syntax_template.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c index 8b337c75d0..d9a65a9c19 100644 --- a/libavcodec/cbs_h266_syntax_template.c +++ b/libavcodec/cbs_h266_syntax_template.c @@ -3248,6 +3248,12 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, FFMIN(ref_pic_lists->rpl_ref_list[i].num_ref_entries, pps->pps_num_ref_idx_default_active_minus1[i] + 1); } + + if (current->num_ref_idx_active[i] <= 0) { + av_log(ctx->log_ctx, AV_LOG_ERROR, + "Inter slice but no reference pictures available for RPL%d.\n", i); + return AVERROR_INVALIDDATA; + } } else { current->num_ref_idx_active[i] = 0; } -- 2.49.1 >>From 6849581e70ce68c7bb096fec062a332ed56aa9c9 Mon Sep 17 00:00:00 2001 From: Frank Plowman Date: Mon, 29 Dec 2025 22:14:53 +0000 Subject: [PATCH 2/2] lavc/vvc: Prevent OOB write to slice_top_left_ctu_x in PPS CBS Prior to the fix, in the case of a tile containing multiple slices (pps_num_exp_slices_in_tile != 0) the number of slices was temporarily allowed to exceed pps_num_slices_in_pic_minus1+1 and therefore VVC_MAX_SLICES. The number of slices was later verified, but while the current slice index was higher than expected it was used to write to a array of size VVC_MAX_SLICES, leading to an OOB write. To rectify this, the patch adds some checks at an earlier stage, to ensure that the slice index i + j at no point exceeds pps_num_slices_in_pic_minus1. Fixes #YWH-PGM40646-30 (cherry picked from commit 72a38c12e5b84ccb30fba88c39ef2a086013af5b) --- libavcodec/cbs_h266_syntax_template.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c index d9a65a9c19..4f6ae76e27 100644 --- a/libavcodec/cbs_h266_syntax_template.c +++ b/libavcodec/cbs_h266_syntax_template.c @@ -2011,6 +2011,12 @@ static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw, slice_top_left_ctu_y[i] = ctu_y; } else { uint16_t slice_height_in_ctus; + int num_uniform_slices; + + if (i + current->pps_num_exp_slices_in_tile[i] > + current->pps_num_slices_in_pic_minus1 + 1) + return AVERROR_INVALIDDATA; + for (j = 0; j < current->pps_num_exp_slices_in_tile[i]; j++) { ues(pps_exp_slice_height_in_ctus_minus1[i][j], 0, @@ -2031,6 +2037,13 @@ static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw, uniform_slice_height = 1 + (j == 0 ? current->row_height_val[tile_y] - 1: current->pps_exp_slice_height_in_ctus_minus1[i][j-1]); + + num_uniform_slices = (remaining_height_in_ctbs_y + uniform_slice_height - 1) + / uniform_slice_height; + if (i + current->pps_num_exp_slices_in_tile[i] + num_uniform_slices > + current->pps_num_slices_in_pic_minus1 + 1) + return AVERROR_INVALIDDATA; + while (remaining_height_in_ctbs_y > uniform_slice_height) { current->slice_height_in_ctus[i + j] = uniform_slice_height; -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org