From patchwork Thu Jun 27 17:53:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Plowman X-Patchwork-Id: 50196 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:bc92:0:b0:482:c625:d099 with SMTP id p18csp631031vqy; Thu, 27 Jun 2024 10:53:53 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUX7k5HSwhJ0WR/YWAKoO00PFhyiJtelTf1qC4nP+9pKviRijL3NNUcVoBEa9B6w4EhdTnq/k48cXQVGM2A2osiQ1c4RKh3rt6qtA== X-Google-Smtp-Source: AGHT+IGyrKc+52NPV2dvnpzcO1gQcO6x/Amc/Xna+6HePtnFan3BKqququo+wPdjTceC1t6Q4dVR X-Received: by 2002:a17:906:905:b0:a71:fa0d:7319 with SMTP id a640c23a62f3a-a7242cdb129mr983564866b.55.1719510833098; Thu, 27 Jun 2024 10:53:53 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a640c23a62f3a-a729d7b2f5bsi85919966b.565.2024.06.27.10.53.52; Thu, 27 Jun 2024 10:53:53 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@frankplowman.com header.s=zmail header.b=TftvXfXm; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 57D8868D586; Thu, 27 Jun 2024 20:53:49 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from sender21-op-o11.zoho.eu (sender21-op-o11.zoho.eu [185.172.199.225]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A595B68D1C8 for ; Thu, 27 Jun 2024 20:53:42 +0300 (EEST) Delivered-To: post@frankplowman.com ARC-Seal: i=1; a=rsa-sha256; t=1719510817; cv=none; d=zohomail.eu; s=zohoarc; b=HfB6UJSscWC4ExpnHEYV7/bFXEuIbQ5qE6SsFZoawjaqdfQ24CDdUXEhElnJcslEumUsygWe4oIAwgy6W0Rtwdizn/HscPtFIMW7zyeYc4+XThhyan2UN/BMcIlvhYAIf0ri1HaQK8rma7zEvdoD4fkGEKkjQc2oqjjK+Rq5E6E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1719510817; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=eROY3ai7bQ/PIiT3jjg2xCY9A9pOMOCBdyJibSadph4=; b=eEsp8ZwBn1Na7eG7iH+0EAdVveUxeyJzbZt96lPMqhr7ypgGDJMd/2BScma68PoAm6uYLeGw0pDY9aUz9PSFERjCPGrmPNGg8luTTOJGR2r4Fi+PqBRBiUBjy6bQ6wDm2LBVrsgckvTmp2AhuwurrVYdghSJGRhplD/8qwhbemo= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=frankplowman.com; spf=pass smtp.mailfrom=post@frankplowman.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1719510817; s=zmail; d=frankplowman.com; i=post@frankplowman.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=eROY3ai7bQ/PIiT3jjg2xCY9A9pOMOCBdyJibSadph4=; b=TftvXfXmLa38QjioOWjCje2gG9OeCoIIlPnclUGW1AIvl8WnHJk1Qo4y3f09bPGF VM2dJyNufNuL7Z3HPe5Yr1KKig0nt9GZ8zpoH2IhBj8+QJoJ4aQZ4jVJy84mwgJHBPx MirQcHgCT2dwlk/yIVukH6gsCw7Jo95qnG6pKxho= Received: by mx.zoho.eu with SMTPS id 1719510815480890.1649845129789; Thu, 27 Jun 2024 19:53:35 +0200 (CEST) From: Frank Plowman To: ffmpeg-devel@ffmpeg.org Date: Thu, 27 Jun 2024 18:53:14 +0100 Message-ID: <20240627175327.65772-1-post@frankplowman.com> X-Mailer: git-send-email 2.45.1 MIME-Version: 1.0 X-ZohoMailClient: External Subject: [FFmpeg-devel] [PATCH v2] lavc/vvc: Always set flags for the current picture 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 Cc: Frank Plowman Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: i60uZpG9Cu3V ff_vvc_frame_rpl uses the flags to detect whether a frame is in use. Therefore, in the case of a CVSS AU (RASL/GDR with NoOutputBeforeRecoveryFlag) with ph_non_ref_pic_flag = 1, the frame would be freed before it is used. Fix this by always marking the current frame with VVC_FRAME_FLAG_SHORT_REF, as is done by the HEVC decoder. Signed-off-by: Frank Plowman --- libavcodec/vvc/refs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vvc/refs.c b/libavcodec/vvc/refs.c index 8b7ba639a3..26a5b0b34c 100644 --- a/libavcodec/vvc/refs.c +++ b/libavcodec/vvc/refs.c @@ -191,7 +191,7 @@ int ff_vvc_set_new_ref(VVCContext *s, VVCFrameContext *fc, AVFrame **frame) fc->ref = ref; if (s->no_output_before_recovery_flag && (IS_RASL(s) || !GDR_IS_RECOVERED(s))) - ref->flags = 0; + ref->flags = VVC_FRAME_FLAG_SHORT_REF; else if (ph->r->ph_pic_output_flag) ref->flags = VVC_FRAME_FLAG_OUTPUT;