From patchwork Thu Apr 25 14:01:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuo Mi X-Patchwork-Id: 48256 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:2d06:b0:1a9:af23:56c1 with SMTP id tw6csp1402009pzb; Thu, 25 Apr 2024 07:03:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUS/NzlPVTw9L9lUixvNv0mgqk/VHFOgG2J8MrHAPZD8tatPhqQSx5LeShGXnZ+4tkkraCaTSoth+DUNahbmTGaFEEfJmwJsVGpOA== X-Google-Smtp-Source: AGHT+IGxqF9Z/AzSpd21UL2FTpFA4sJ9rg6U2BOOPxkd7DWCD/4U/6Wpwc/BU7dgyIeNfy2/1PJc X-Received: by 2002:a17:907:86a7:b0:a58:be1f:9134 with SMTP id qa39-20020a17090786a700b00a58be1f9134mr1160728ejc.30.1714053790870; Thu, 25 Apr 2024 07:03:10 -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 kt6-20020a170906aac600b00a55b1959c82si5646965ejb.285.2024.04.25.07.03.09; Thu, 25 Apr 2024 07:03:10 -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=@outlook.com header.s=selector1 header.b=f7KiVcE+; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 64FD468D3C1; Thu, 25 Apr 2024 17:03:05 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from SINPR02CU002.outbound.protection.outlook.com (mail-southeastasiaazolkn19011003.outbound.protection.outlook.com [52.103.65.3]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7DC5668D232 for ; Thu, 25 Apr 2024 17:02:57 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yl2Ryeq/WY7x+x5tnf6Wxq1PdTJHmfR7LC/aupzBBu1uUpt939yDCcpoBlpM2taanafFEfUz5bLVIVDX/KccsF5CkMP+64AGIKABPD1hVZakkEwRZl8QfVWa+SU7TyRJO07LFO51ELzrE5/pod2YIJ115kt1XbdN7HazIDf8cSpGN7e9fZlUIfTsc1oliKl6vyqqkM4s7wElHthB8a/PsNyHFLglUwrf2hc0TEgBNdQ6YtMZLX0zvtTatYlxBYc85vPWRFY+X1cUjzCYaEtqRyecQRMtpbOjfuYBf01Vqr9RbnjdjdL8+0+MzHtHxhYNrYTxyVell4DtdBUmh89O0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ysne0X8YeHpMP8+AVm9hnZhtOQEfANm8vNMJN6nuAWE=; b=gXKB/TvTpXUeZlMcljK1Nwidtk0HUWKuI5y0A4+yR1UQ4ttxBZu7lVYzmKQp7n5lUSJYQZdhG/iPuJ08ZYXpDRn1rdZES3dmw0+oNVDiZwDsI55FViMJ+YE3bYtAJFd+jEl3+8nrTvKYZeUVdbwdKdjIiVltbDQ+s5DUnCKOA3mgCZsYK9GRGUF0aGngWA2TyNzX3QlzdDscpodURk9a4Hi646zv/nZHr09GS1x9MpGjoNWFbNjzBhCZJRCyaRkwSK+jnEpjHGRMzWxFFMAi2wPMJ5ClPfhZvjKj0K0S+/WPsIboRvM9Sn0lE5PhU9y8FYTaZ6JeJAQ16WqBQ1GM+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ysne0X8YeHpMP8+AVm9hnZhtOQEfANm8vNMJN6nuAWE=; b=f7KiVcE+AWaEmzyvZfPiVlif0TfX+KeP08LGaIwDxufFFycuG9V0w4LOT1icq5LP4JvAfAZfQz+CCTHzXg0TMrU7axw784vPVcFkC82ipTQCCRURgG/ZclPDtOTNtSmNCrgJKEeXlA9NW+J5sTNwva16iEfpL6Y5bxu2iFT1Ti7FYu/dzCrizqxxEcQMcn2VG4IbFqj1RRvcQXbk6fBLsWmXPyI9u2nUoQRi8a3/euBRlqa9pDO7XeU/pw93QTjTk4okFSyyDCqATq2Hi2r+17Zkr6QVnxXy2wApZvyVH03jODuiSTkxmjyxXbyNdbJwsEFVG9MhTxohQ+twuLIvvg== Received: from KL1PR06MB6426.apcprd06.prod.outlook.com (2603:1096:820:f7::5) by TYSPR06MB6436.apcprd06.prod.outlook.com (2603:1096:400:475::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Thu, 25 Apr 2024 14:02:52 +0000 Received: from KL1PR06MB6426.apcprd06.prod.outlook.com ([fe80::42d1:d71d:9f80:18af]) by KL1PR06MB6426.apcprd06.prod.outlook.com ([fe80::42d1:d71d:9f80:18af%5]) with mapi id 15.20.7472.044; Thu, 25 Apr 2024 14:02:52 +0000 From: Nuo Mi To: ffmpeg-devel@ffmpeg.org Date: Thu, 25 Apr 2024 22:01:35 +0800 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [GfqPybcKPv4Ygz9K4zKaaFgRhCiR31oV] X-ClientProxiedBy: TYCP286CA0196.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:385::7) To KL1PR06MB6426.apcprd06.prod.outlook.com (2603:1096:820:f7::5) X-Microsoft-Original-Message-ID: <20240425140136.96867-1-nuomi2021@gmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 2 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: KL1PR06MB6426:EE_|TYSPR06MB6436:EE_ X-MS-Office365-Filtering-Correlation-Id: e71fc57e-e171-4b41-3d15-08dc653065d0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2LjKLF8Er6Dy0YgaBHk3gCpuFtyVYc8iwRIMR+okSn7TpLghJC87TRL2Rcx4UK02UnKTGm04dRL6VPjIpyemkLSa/9qmb80+4ATgDdqMJUUYPhIbHy54OroEdHFsYK5Y8cOCDw/T/qAO7K5Hvh7N6o0GT8VIfoBtBqkTpzYKM3JP3imFaBtmTDGebrazUTWR1DBzLNI8rjH3zn1lWa/PhuYXlq/XA7zWlVkGFDnjvKBMNXiHG1EX5ZxBLd5RC0CwDCyTmEtcA2Y3HofXoWaR+nq72KdXX5XeZhfsBaakaH5OhrNELi1fp5J3ERR61iuHy27FvXFTPPi+3GGIymxXQWbaB2xBtWQ4RtKDdsPmK1kcVbMk6JdlSeccw1IzoeE2uQH4QRRucGbps2B4OlyiL2NwRMsBbizzlXZ5bT2Kzs+BoOuFSJSM6kVQ5mjHobdU9+Ks6cOYMxfPxGtTFMHBQS+IfUi4Wxip3FpCEaJjUayBCmjJvBmYfuyPkRgzp3Q741ZqgKTi2bThC5WQftootuBPFlt97hhr48VsCOA3mKCcmzNlcg1XWOw6a7TEJLsZqY4Ss84h++04cGMe0g2QfW/iDBc65rcbxm4RP4eNXAarLKyHVdu3KBA7wjdF7y2Q X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-Message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Xlr731obOreITHHkO3vPKO5sL1CXiMbCq+NWbEANVQF4UknbouM7P/N//8pfllUFHz6doVgs5N6eM1Fc1WHnlHpwakDgkQIllHIeEvYB/pMbW7sFh+AXzWW/iZPhbDLZLzMWovj/i89zmxZ63bDuv1nyZMvrdh3biLcJicl2hUOOVLk3Coh/OnNRXJQ07DA24db/o1HbgDocJKJP6jrisc9y72n3SuehA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e71fc57e-e171-4b41-3d15-08dc653065d0 X-MS-Exchange-CrossTenant-AuthSource: KL1PR06MB6426.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2024 14:02:52.4644 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYSPR06MB6436 Subject: [FFmpeg-devel] [PATCH v2 1/2] avcodec/vvcdec: we need error handling if fc->ft is NULL 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: Nuo Mi Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 9T5pIMGkQwjQ Another inter frame may be waiting on this frame. We must finish it to avoid infinite waiting. --- libavcodec/vvc/dec.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libavcodec/vvc/dec.c b/libavcodec/vvc/dec.c index 6aeec27eaf..92999a3ce3 100644 --- a/libavcodec/vvc/dec.c +++ b/libavcodec/vvc/dec.c @@ -854,6 +854,13 @@ static int decode_nal_units(VVCContext *s, VVCFrameContext *fc, AVPacket *avpkt) } } } + + if (!fc->ft) { + av_log(s->avctx, AV_LOG_ERROR, "No frame in the packet.\n"); + ret = AVERROR_INVALIDDATA; + goto fail; + } + return 0; fail: @@ -948,9 +955,6 @@ static int vvc_decode_frame(AVCodecContext *avctx, AVFrame *output, if (ret < 0) return ret; - if (!fc->ft) - return avpkt->size; - ret = submit_frame(s, fc, output, got_output); if (ret < 0) return ret;