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<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;
 }
