[libcamera-devel,08/14] libcamera: yaml_parser: Increase sentinel to 100k
diff mbox series

Message ID 20220908184850.1874303-9-xavier.roumegue@oss.nxp.com
State Changes Requested
Headers show
Series
  • Add dw100 dewarper support to simple/rkisp1 pipeline
Related show

Commit Message

Xavier Roumegue Sept. 8, 2022, 6:48 p.m. UTC
Signed-off-by: Xavier Roumegue <xavier.roumegue@oss.nxp.com>
---
 src/libcamera/yaml_parser.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Laurent Pinchart Oct. 3, 2022, 10:16 p.m. UTC | #1
Hi Xavier,

Thank you for the patch.

On Thu, Sep 08, 2022 at 08:48:44PM +0200, Xavier Roumegue via libcamera-devel wrote:

This is missing a commit message.

> Signed-off-by: Xavier Roumegue <xavier.roumegue@oss.nxp.com>
> ---
>  src/libcamera/yaml_parser.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/libcamera/yaml_parser.cpp b/src/libcamera/yaml_parser.cpp
> index d8a7c2f9..abca6903 100644
> --- a/src/libcamera/yaml_parser.cpp
> +++ b/src/libcamera/yaml_parser.cpp
> @@ -676,7 +676,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 = 100000; sentinel; sentinel--) {
>  		auto evt = nextEvent();
>  		if (!evt)
>  			return -EINVAL;
> @@ -690,7 +690,7 @@ 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 (100000)";

Could you define a constant (constexpr) and use it above and here ?

>  
>  	return -EINVAL;
>  }

Patch
diff mbox series

diff --git a/src/libcamera/yaml_parser.cpp b/src/libcamera/yaml_parser.cpp
index d8a7c2f9..abca6903 100644
--- a/src/libcamera/yaml_parser.cpp
+++ b/src/libcamera/yaml_parser.cpp
@@ -676,7 +676,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 = 100000; sentinel; sentinel--) {
 		auto evt = nextEvent();
 		if (!evt)
 			return -EINVAL;
@@ -690,7 +690,7 @@  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 (100000)";
 
 	return -EINVAL;
 }