@@ -668,6 +668,7 @@ void YamlParserContext::readValue(std::string &value, EventPtr event)
int YamlParserContext::parseDictionaryOrList(YamlObject::Type type,
const std::function<int(EventPtr event)> &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;
}
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 <xavier.roumegue@oss.nxp.com> --- src/libcamera/yaml_parser.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)