From patchwork Sat Jul 2 22:21:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 36612 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:8b27:b0:88:1bbf:7fd2 with SMTP id l39csp1884362pzh; Sat, 2 Jul 2022 15:24:45 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tuCxyPOCUPBcc+V4A9qQKkh85CQsDJ5wnNfKPnrUUz/nfJ652IVZWN6h8IVaX6c0T0V/+I X-Received: by 2002:a05:6402:22a1:b0:437:78c2:d02b with SMTP id cx1-20020a05640222a100b0043778c2d02bmr27942078edb.64.1656800684968; Sat, 02 Jul 2022 15:24:44 -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 k17-20020a170906971100b007157d4e84b8si7737273ejx.304.2022.07.02.15.24.44; Sat, 02 Jul 2022 15:24:44 -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=bR2P4gQn; 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=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C2AD268B9B3; Sun, 3 Jul 2022 01:22:50 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-oln040092068054.outbound.protection.outlook.com [40.92.68.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 53FD368B979 for ; Sun, 3 Jul 2022 01:22:42 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AcOnJObQIhfmsQKFUcjR/tHGMT2HzPADTwzv4tNHiMrHjPRQ4kdb1xwa4wgXt+DNygQnxt8/suzyEGE1rj2cBBw94Qy9G9K5Uzm8bsdEP71q5A+xkQpb6jrRHw5f1nVeZLC+TcX9NIBhr6ALnmTNYbboNloIb3K3Hza5ssJxWHbF0q7WSfeILCx9wvTtGG+uIVqjwA5LgDPx7UcGmgvGHLqvmJO0U1FQDTuSs3KbF4FBs/Mv34pijjOjUqDZtRKTO5B5C6aKyLcARfv+epR3EHTNDCJ56nwO2TfaGgu7S4TJqXGkrVToqjzN8NL7O6CmnkslEihszsmC3hDVR/LCRQ== 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=viQGmEUyH9b0Go+Rouf62BqGSIuL4j9zYoCzrD9jkTk=; b=YiWVB5zUuutMQFrt9FwHinUw6CGGsp9J08ylxeVy905EyIQdiiaFfBc6Ve6OfcqQTmRIBpxLmJjCpuQRcfi6PTAyFcLXNSW3lhGG+PIdfYc1pqtgwNfRdHhsKQgTpkrfXmVho74MTzqDteSJkTGcgk3Fg7yEE/li89E5xwK+z7VW3dtephUZgjHhvYN9FxsWeWuvwoID3Na2yky1yLG+ilXgXmfPQD/k9eouREuYtOkVHZeelzenZ/dWHD0ThZWhjNCWF8H6C/UEkBKAU3gSqn27N7Z+Aa6pEgifkpqfLBVUC+/6z8PUiQOrImlGj9QP8Fj6Dm+88cpqNR88jukv3A== 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=viQGmEUyH9b0Go+Rouf62BqGSIuL4j9zYoCzrD9jkTk=; b=bR2P4gQneZGYjHWi36ZmNG8j6jlhX+P7SlXrRGWwuvFp+xr2u1nILzNuWY8hwq3PingfS3B6Gd0TZD/QDlXisJn2M8DLWZqvIVsEIOHm+52se6Zv1GtaXtgy0pkkE+go3vOlQWYIrTVve0EhbKY1S62FVWi6ybEdmYA8Dbio3Vs/KTNgoeU2RzhYjjr9IVZlunkWAcO2dD4jZGE5TbfX1H9werWV3yW9NMN7NaRBYIBkq0eaX0VTvEF6X8VUt4IbPWCHZAt4Yc8i2gvdSWRT6HqEv9j2oea80RQIlD6SDrgu77zLVvvUVJgN+LRqB2Oed1lbIPR3/f486HmU4j9peQ== Received: from DB6PR0101MB2214.eurprd01.prod.exchangelabs.com (2603:10a6:4:42::27) by DB8PR01MB5948.eurprd01.prod.exchangelabs.com (2603:10a6:10:e4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.17; Sat, 2 Jul 2022 22:22:38 +0000 Received: from DB6PR0101MB2214.eurprd01.prod.exchangelabs.com ([fe80::60b9:9f29:40cc:f01c]) by DB6PR0101MB2214.eurprd01.prod.exchangelabs.com ([fe80::60b9:9f29:40cc:f01c%10]) with mapi id 15.20.5395.018; Sat, 2 Jul 2022 22:22:38 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 3 Jul 2022 00:21:57 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [NEQefC3QTvUIK6zFsq99lOj/Yf0QhlFe] X-ClientProxiedBy: FR3P281CA0089.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1f::18) To DB6PR0101MB2214.eurprd01.prod.exchangelabs.com (2603:10a6:4:42::27) X-Microsoft-Original-Message-ID: <20220702222200.169681-16-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a1642ba2-a52d-4a0a-b4e1-08da5c795ec7 X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiRfEAUNR0l8e+jWTbrQIj139kMLRnFOrKDlW2GDcqZEohwEEailzfF7QE7/odYW++6E03lPX1Zgik0OmelhI/O/tTLYCSQjLXRgtshX8b2/N/adFARIJe9jDJLrLjaZyq1oKY2dbCKRkU7wfJpc6yA+hj6l43ZacLHuMt7JfCe+gDQVcn7vFiE7FlYSvchC2nyZ/ugypmLdquMv90PWj2CAA+Qo2Nm+0VOPfvySWrVOT3MEBdRyGEPl13pMGrTv99+l21EekAC4CysRM3u+4zZ2vX7+4bD7m3QnJfezOmyjN5N1VWHzdG81lvHBfQP9E+u8gl8cJL8LCpV+CNeggYaswEFcwDuG9MSHXqzdWPdwyQj0Je9UVS7mOLKL2pCDwWsfCKvfr19kXviKuuN8nGJY0oRDhYhlQiDRrVp1fO/i3VBRQAgVwQo+77v/fCAJmCzSdnt6mebQDeZMFDmx7OsA5Wj3v1H4pv4bpE3AAT/OSod6Xt0z7qUokxWqbJX3r4r6K1EYVx6oGoDRoYipIbk/+UbGmWteua44xscXTAfaTLzFdnpei78ZtrlXcRoZ3z7r4PdaprmOH7G6wLVonV/bksz61icbYwkMBkuAu1PEHiGQ07StgNsnsJVzFSXmoseHCxNT+ZNhZPPqpSMGR5Sk5pStSCcivq+JDO+v1eeVNVFKu02jkwremWDc9yVynDU+hoXZ6y3XyeRnW3K1PX2I35rVMiP6K6ziZHivslhlN6xhbQe67TrSF2ccJfrp2xY= X-MS-TrafficTypeDiagnostic: DB8PR01MB5948:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6McJeSV1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urprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2022 22:22:38.0279 (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: DB8PR01MB5948 Subject: [FFmpeg-devel] [PATCH 17/20] avcodec/h264_ps: Don't output invalid chroma location 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: wiB5mixNHqwy Signed-off-by: Andreas Rheinhardt --- libavcodec/h264_ps.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c index 1fd7375a13..874790a3a3 100644 --- a/libavcodec/h264_ps.c +++ b/libavcodec/h264_ps.c @@ -181,7 +181,11 @@ static inline int decode_vui_parameters(GetBitContext *gb, void *logctx, /* chroma_location_info_present_flag */ if (get_bits1(gb)) { /* chroma_sample_location_type_top_field */ - sps->chroma_location = get_ue_golomb_31(gb) + 1; + sps->chroma_location = get_ue_golomb_31(gb); + if (sps->chroma_location <= 5U) + sps->chroma_location++; + else + sps->chroma_location = AVCHROMA_LOC_UNSPECIFIED; get_ue_golomb_31(gb); /* chroma_sample_location_type_bottom_field */ } else sps->chroma_location = AVCHROMA_LOC_LEFT;