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 41A7540D15 for ; Sun, 19 Oct 2025 11:42:18 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'ar4R6TVs37wjweFnrhVdfb2+cH9wR+PxwNjM8LYXKr0=', expected b'++4+IUwX3x+2/EJzbb51JqAOP6W7StuKb7yyNRX4ZdU=')) 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=1760874122; 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=ar4R6TVs37wjweFnrhVdfb2+cH9wR+PxwNjM8LYXKr0=; b=glMn16jJAgHonLoQqivH7MGwiHpQRtYfC4PmMEMICbB/CghjhM9VORuR2CoDCZabuCB0E rdDsLHwP3PS11AI9pO/ZgDNH6KdmG+vDQqJ+HhKS9Ds2TPdKYy/n/nQ7Nt+SffatttxMG5o pvy6z/hy93y6se1AS+zjWcy6ra1ixDt0vPZ7wBzWFA/Euvlb6aJ1rRJU4lRXi/4pp4cPMsb MsrZXadB7TL0uLIMChHV+JjVNIw+GQ7e/tEUon5iDsGIB6YW8hnSyxQpJAqNZpwSJXyHLG0 u5zFk6IhhHY015yAA0Nb20dKK0Oz7HW5PCx/ihaX3IvGYLETabQMr+xFqGww== Received: from [172.19.0.2] (unknown [172.19.0.2]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id A2BD168F4B7; Sun, 19 Oct 2025 14:42:02 +0300 (EEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1760874105; b=CVxIpBdGxf8Kuyzr+cc4wPn6Etq+IpM5QC3AXZj8bkbQJmSr/Vafiri6w90LCC5V8gQDz j/IM9S3FXVkMVbLf0BksvaP5ZpkL0WvbV4LSqVEPImzTETJ5DENIM/i67dCC3EC6OUWfI4O NnpgnckUMYF4y57dJltw0Uvj7tbSvN+xSjHcDEqTW9+oiEM05vjQg5GKLL+T+LpqS0ZRIOv rXa191juITPj9AyEPqCd45E8IviOlGvjYC9BBC6HzbjiTFYjDlgUD7SgkNpx/q3iXaBwEqa o7C4aPJZ+eJu/6SnvX0IOfvX0GsooQD0MN7LQt6XtpjTonYohtPE/Yrr9sEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1760874105; 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=VTqnwFK2qmycKOW3qouhLNGK3gX4CtDp8IS/b1ehO1Q=; b=CHpwVrK7D94QNjfx+2uZv+tNSFkn0o45zSA3hd5Fz5f12/bz6fANpt9veuv36OdWjgfq9 h22R/UkASOTHYWxjLepuf/eyE28iDaMR9fwt+fBK1Atdz3G6kRxgAw1n6LYYo+qGdG8hvCl 70u+HepwNWAdT2FG5WmK3keGURmAUmFqHy/tyyqX2+lwbaxus2s6mn0BpqDauz72fIPMu6A vGiUXWY1kNKTAzH8aM/QzM1fpjB5c4LD7oSUA0LocyFY/Hdm1webpwkKQqpIkr8qk66SZs4 q0MLNuDskV6FChHL42ZmWK6nfGNOyVGVcuOvrwVFSZLJmeJhrZqfoHKp7L6w== 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=1760874099; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=++4+IUwX3x+2/EJzbb51JqAOP6W7StuKb7yyNRX4ZdU=; b=OJkpXY842fytEa4Y68u5axTG71zJz6EPACvpaKpFpB8wpVr1RyKJA4g/f+G7L8gk49uaU 8UKyoEuzrxhUaFOcK6euBCspIrApQcg3ISBwBdAzMn5UQVrWjwuRJJeca+Odtf6YAikuSRm rjrpkBV1xDoNXIN2X5uUJJqGL37kyAqEakrnWGwiEvvlFVPw8cr7CPGT3T3xDcGBsY6C6vk XVuQhEDbJvEwwgs3EC3vXpwVWpicT+hrl90WvtZ3kbYmkl/g3CuyOHfZDGj5DVti4AieNL7 hoAFQZu8kfX4prENhOMkJdzfpL4vIpVJTotgWBBZup5jheQmlS9nMkpPUgvg== Received: from 547bf0a948a1 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 1740968C777 for ; Sun, 19 Oct 2025 14:41:39 +0300 (EEST) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Sun, 19 Oct 2025 11:41:38 -0000 Message-ID: <176087409922.62.3850657758959997196@bf907ddaa564> Message-ID-Hash: HG72MMTLN27QFHQWSQFZW44J3VLKXGVN X-Message-ID-Hash: HG72MMTLN27QFHQWSQFZW44J3VLKXGVN X-MailFrom: code@ffmpeg.org 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; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH] lavc/vvc: Ensure seq_decode is always updated with SPS (PR #20717) 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 #20717 opened by frankplow URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20717 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20717.patch seq_decode is used to ensure that a picture and all of its reference pictures use the same SPS. Any time the SPS changes, seq_decode should be incremented. Prior to this patch, seq_decode was incremented in frame_context_setup, which is called after the SPS is potentially changed in decode_sps. Should the decoder encounter an error between changing the SPS and incrementing seq_decode, the SPS could be modified while seq_decode was not incremented, which could lead to invalid reference pictures and various downstream issues. By instead updating seq_decode within the picture set manager, we ensure seq_decode and the SPS are always updated in tandem. >>From e611aeff64a15d12cede6da420e0173c665117a7 Mon Sep 17 00:00:00 2001 From: Frank Plowman Date: Sun, 19 Oct 2025 12:28:00 +0100 Subject: [PATCH] lavc/vvc: Ensure seq_decode is always updated with SPS seq_decode is used to ensure that a picture and all of its reference pictures use the same SPS. Any time the SPS changes, seq_decode should be incremented. Prior to this patch, seq_decode was incremented in frame_context_setup, which is called after the SPS is potentially changed in decode_sps. Should the decoder encounter an error between changing the SPS and incrementing seq_decode, the SPS could be modified while seq_decode was not incremented, which could lead to invalid reference pictures and various downstream issues. By instead updating seq_decode within the picture set manager, we ensure seq_decode and the SPS are always updated in tandem. --- libavcodec/vvc/dec.c | 1 - libavcodec/vvc/ps.c | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/vvc/dec.c b/libavcodec/vvc/dec.c index bfe330e028..028f34b491 100644 --- a/libavcodec/vvc/dec.c +++ b/libavcodec/vvc/dec.c @@ -726,7 +726,6 @@ static int frame_context_setup(VVCFrameContext *fc, VVCContext *s) } if (IS_IDR(s)) { - s->seq_decode = (s->seq_decode + 1) & 0xff; ff_vvc_clear_refs(fc); } diff --git a/libavcodec/vvc/ps.c b/libavcodec/vvc/ps.c index 8faee1d826..a591851238 100644 --- a/libavcodec/vvc/ps.c +++ b/libavcodec/vvc/ps.c @@ -279,12 +279,14 @@ fail: static int decode_sps(VVCParamSets *ps, AVCodecContext *c, const H266RawSPS *rsps, int is_clvss) { + VVCContext *s = c->priv_data; const int sps_id = rsps->sps_seq_parameter_set_id; const VVCSPS *old_sps = ps->sps_list[sps_id]; const VVCSPS *sps; if (is_clvss) { ps->sps_id_used = 0; + s->seq_decode = (s->seq_decode + 1) & 0xff; } if (old_sps) { -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org