From patchwork Tue Nov 15 13:12:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Roumegue X-Patchwork-Id: 17804 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 482EEBD16B for ; Tue, 15 Nov 2022 13:12:59 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C54FA63088; Tue, 15 Nov 2022 14:12:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1668517978; bh=62/5KkeEkM9i2SIi5hgcW8M3ccT+3Ld7sHQF3polkLc=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=W1a2Y0NUXJ+zkbNCMI37HWloRrCc/TDNamPYuNABtXemEDw+jCsxaU7+UTCxU4h/V Ee9Qv1QbID6VuC/h/QeiSX2UMqjZpDLcQeWhBnsGYInhDD2xnSxFNIfSJpR8VC2+6J k7MrUbqPGfL45nuvx+zwCupSTOdmH3oe1RTt+Pph2GDGE/Hm6hZpjKaSzW/xDJHkej ig3DwplTGhlG+iz6DoMzM1qCHPLyyIw51Q+HTlVybIYnOGbFxgguHqKxaxQeZbj3Vk GLabS+JPVxRNTknFePd/u6bvoQo4QV+Tm2JYGkfTtjdFkg+b/DRTTd72+K1RgSHryB A+ChxwvtHnMyw== Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2062c.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe1a::62c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CE3B763079 for ; Tue, 15 Nov 2022 14:12:57 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="k9iACLuG"; dkim-atps=neutral ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TBM6OaFfiA+BK8XVw1zuTrtqsIwLkUID4ReYpEufVfTwGMf2jUdxf+FSrnFFexES9MCXcGfr7hGU0wK0vDrW5ytWbqeDzWUu/QMUgdyW2NP/DY8MdWVxcITFDVkElmgnUu7ll7G8iUghhYkdY64TT3t0gsC6Wlm02MhploCMvPumAd8vLNsETsGljtFBa9zWHskqP8gIMLl4RFoPIEVpweVIQf/PhkZqfQFfrWbvF4p9xP2IP/P2g7ANTDLGqxj2h7HQ6EjDxU8rYx21x1RfR3riH0ffz84GW2zHedXyEyO61vatxYYaQ6W/x2Oo9pimFS4U+OqvRE13IqPlhGt2eQ== 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=9Lee7jCOdHxAIQFPYv0tBWGW2EGeVytWDbDj8loR+SI=; b=fdxK9ZfTjpjWx4aTncrAcTHX1LvNk7/DqPaKtmpCWaliTrS6ZMOs+gyLVx1/kQObNZbZATrMg9p2i9GnvWOvgMSYA5Iv8bak64xP/T4DcWryqYsMtwMUW847hvu741hHb7NbSh/daaS655s80bNHmKMuEfdzTUqHH/+8N8E6o1zYx9OfWRa9qq9ycbOzcbr1bpW99qy6UUCLpqETYnejACo0m3IU7x4ktJBO5cHlwv9A1rCbun8pmxs8wq+sq6nmtoshP4wYrAQBvX70PmtZrvArXCwfxPQ+DA/rnDNojZzcqos2V3Lf80CXv947Pb5l4zCEL82Nv8QqaBCe2krRgg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9Lee7jCOdHxAIQFPYv0tBWGW2EGeVytWDbDj8loR+SI=; b=k9iACLuGcz+TXSyq3uHTUPQUzn7YIKFxTRbkOnW43fhpS/jwfXZx9IzSQDGpykKHVwUhURz6Uq1f60/S6vDwsByaDanf6J2M9cBCadI4JEBWtcqaEEhiaB2pcUiphsTTVxViry5edoTPlLONlVu4elhp7ohmOmcYOHQDMKbDn4A= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8703.eurprd04.prod.outlook.com (2603:10a6:102:21e::22) by PAXPR04MB8460.eurprd04.prod.outlook.com (2603:10a6:102:1db::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.13; Tue, 15 Nov 2022 13:12:55 +0000 Received: from PAXPR04MB8703.eurprd04.prod.outlook.com ([fe80::14d3:8e4:cf07:810d]) by PAXPR04MB8703.eurprd04.prod.outlook.com ([fe80::14d3:8e4:cf07:810d%3]) with mapi id 15.20.5813.018; Tue, 15 Nov 2022 13:12:55 +0000 To: laurent.pinchart@ideasonboard.com Date: Tue, 15 Nov 2022 14:12:26 +0100 Message-Id: <20221115131226.2063586-1-xavier.roumegue@oss.nxp.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: PR1P264CA0133.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:2ce::18) To PAXPR04MB8703.eurprd04.prod.outlook.com (2603:10a6:102:21e::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8703:EE_|PAXPR04MB8460:EE_ X-MS-Office365-Filtering-Correlation-Id: 59d13dbf-8e0e-4dc7-5084-08dac70b1b99 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Z5FzSFtplPnP7bKb1IAMoM2pNzhWUcLNqGU7V+y5zaWzTmt9CMjFOC26Ex+zV9XsaGCz+gTFeU5rI63gMf2fivO3nr8GI86R2rekv9xwEOdZerr5utvdwhJwbfAhwFFabZ80XWlgYQHZLI9IAziUA9dTGlwrhcjx39sfIfrHWsoHfdgcep9+gMj2X1ToMcoQ9Gq1ry8HPnfjDY5VHQfAZnGrb0WWrd74V7KjWLv0/2gxTUKpnoBDYIk5tWAqho1KC1gpfhvswaaipKIz2mG0Q1jsmuD9uVI2fRVHbOZS+rlNo42lM4jUfDSr4RiXnY3n10Sz2Pd9c3sajRPgp+riq/knlzvKOxgdL0Li20yniwMU+7eOeg5KjwpNObZng2r2TzBlxc1HX831u0MW/PV4XQgZMa0kUt4G8e5JXwf31oGQre2V9DgnrQYYMfpb2PtVn63GkcLyyLVPKOcK3BoBVw8iqfUklsIZx0zZo3aNnBMkgIhp4Fvrr5eBPzVbpa2o75QV+++G0eQNQzitK/jUwa/k1eTLsGsprHLfKLEVz34owwKTJe/fl++wVBaeLTnwcF2DUUrAtJQpnkqgMlxtEr2GtOiYiqwc9o4pjrzuEQHdSPB5b7iK1lGFAkNutdtiOS5bOzAFTJDS3dUoqv4uSlwWwZ65VkPGBH+hOn0YKdjm59CyPTSpVK9ie96bilDB9YpXmaQA6AMxgLo3Cp8AHg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8703.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(396003)(136003)(376002)(39860400002)(366004)(346002)(451199015)(38100700002)(4326008)(44832011)(316002)(6916009)(2906002)(8936002)(66946007)(66556008)(66476007)(8676002)(5660300002)(478600001)(1076003)(186003)(6486002)(2616005)(83380400001)(86362001)(6506007)(41300700001)(52116002)(6512007)(6666004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 24nJ5NRzhn3DFs4veJnbWj5wy0Zc3FH1sWZ1lVbda/CYdTOBhJ0BqJTd7BqO7Y1Db/Fd6EvRzweFiM/mJTgiHM+kRbH9f3D89dRCxgXbxe1YUmF1XvAeOU2+9ju+cI+cgzBE9gAXJxuoWqvlUwph2PudlMUH4/CbDDoGOdStjAUC16FjNvtyACj/baH8UZFmA56KCxZxmtaG5fBbLjoHiHaSZjKyZZChB7TshA3UNBtp8C2jDfXX8sSe2G5qscs4QAXLuTORSMVtXiFgQfaV8/+rTIIm2nPNArQ2VgN6rxtXH2Ok8lSRxVyGDDGavnehipRa3jMgB04IGPvRwssQNzETVFQ8hSPO/g5p7oSTZ8ZQflS3sunZW3sxcvTKOV9SqQJXRyWiYWPqZkcy24veLZCx9ubHn8jKVcHEEp3USEiytzrKN6ENeIQbH/0m+dDRufuXmuFVTRiUEpYBmPUVgh6xLqsid1ziEhzELFAhAe6s/9fHJcxEHGip7C6LFGy9xuE58xF2wNvu2193FXpfqdGzUhXFnLIAJLZEfm4T7/f1QhsqPD2ntHCqBavVduffKQy0inRS5MZp0tQJVIPAp8TRyx1wfpGAWQw/pi+aA+M/qNI7gBFgn/Tv7/LctwGp9NfOCWQ17JWHjwE8kugUDPCeI/muwhj6gV6bjpkMKn+Pt6pG9x/aMtAmSGVl0TttESrWEfubqFTUV0YVPRGUU3luW+e4Yy7miGaweL3MCnj0Lj3Mj6QfznHoXgieCgNrPO6CNM5mltrRjEG4HCOPNJyLJVeDtULlNf8bTzvJBt9Vr0rG5NNk7Ku13vULUGQDy2cZAH4rxpZsFHcbWvJsVaLESF99MIYtm0mzd+P364lAatijIoFg/iv2gr9ZdIdn4T9OJs/89UoPZ0jH1mllmd5Njz8F+6EPHX0VZWrhr8IyLouKOnjinY8LpgzuZVkwnrsNOrLsI+wTXBVTVpvk8XMDAD23sN6iz68w6IOunkjrS3sOhAki+jBssIXUSDSY30dyLpt5493Tkjvt4urpR9K4p3A0QPoIpHlkOAmKcLebnZi1bBk6Xl78OY9yvJqHdxPfBXmlAaoNRNIyuIjX/KAYxK9roY2Lr/Snb6rRaeDfllbPVvR6eBV/lp+ylFIaQPfkH+equgsUMboPHH3DBClr7qO9DHmiDnqqC3chN5QRa5fFVZUq9jsnGbFPE9rWrWYOVUObAXJuiL9htKxwSmC8EzBR3Z5iGpYSd8igh4jxe6g28FMMbLurAyX4NZV9XMKh2rQ7VAY4d2err9oA9rX2A6MQLOezV3IKEY4WEHhLPWKzQ8QoT4i3bAoXByBHQfl3e8ri22NBCQO/Jt7Y0qkNa2rmvub4Q0KbcnOXffr6zZBYcHqTRH2JwkX2UFr8K7khofQxP/MwVBurhgu3lfMUZdQnV607BwI+2SVHTpLbazdH7Wt0rG143h33vwjaU8nPrRO04mFCD8g2KhrF2BDxz7jCV9ciihi+mt7SKndTqpVfdWBWjpftpONu/GW75VZBJqFSte2iA/AGjntY/65F4B0moy/iJ09J3T2MsZwxHz6d0mijqvY8BkBudgl1QLt34mjL7Z6FznppQPDV2z11zo26D02VfWpzZSaBMvBLxiEHQbmXXYFAZ264T8upinugZQaylJM0nIV1y1TdqA== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 59d13dbf-8e0e-4dc7-5084-08dac70b1b99 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8703.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2022 13:12:54.9508 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5Zq0tCEPsjjr9j3FFD0nFlwFDDxfbDh4EPpRp1nPOfOTeiojZWYw4sYH3D1I4B1MXj7J0W7KFXnSxuuMX9AUYg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8460 Subject: [libcamera-devel] [PATCH] libcamera: yaml_parser: Increase sentinel to 100k X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Xavier Roumegue via libcamera-devel From: Xavier Roumegue Reply-To: Xavier Roumegue Cc: libcamera-devel@lists.libcamera.org Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The original sentinel limit is reached with file holding dewarping mapping coordinates. A long term solution would be to use a binary file format to store high density data file. But for now, simply increase the limit to a high arbitrary value. Signed-off-by: Xavier Roumegue --- src/libcamera/yaml_parser.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libcamera/yaml_parser.cpp b/src/libcamera/yaml_parser.cpp index d8a7c2f9..8bd5eda3 100644 --- a/src/libcamera/yaml_parser.cpp +++ b/src/libcamera/yaml_parser.cpp @@ -668,6 +668,7 @@ void YamlParserContext::readValue(std::string &value, EventPtr event) int YamlParserContext::parseDictionaryOrList(YamlObject::Type type, const std::function &parseItem) { + constexpr unsigned int sentinelLimit = 100000; yaml_event_type_t endEventType = YAML_SEQUENCE_END_EVENT; if (type == YamlObject::Type::Dictionary) endEventType = YAML_MAPPING_END_EVENT; @@ -676,7 +677,7 @@ int YamlParserContext::parseDictionaryOrList(YamlObject::Type type, * Add a safety counter to make sure we don't loop indefinitely in case * the YAML file is malformed. */ - for (unsigned int sentinel = 1000; sentinel; sentinel--) { + for (unsigned int sentinel = sentinelLimit; sentinel; sentinel--) { auto evt = nextEvent(); if (!evt) return -EINVAL; @@ -690,7 +691,8 @@ int YamlParserContext::parseDictionaryOrList(YamlObject::Type type, } LOG(YamlParser, Error) << "The YAML file contains a List or Dictionary" - " whose size exceeds the parser's limit (1000)"; + " whose size exceeds the parser's limit (" + << sentinelLimit << ")"; return -EINVAL; }