[libcamera-devel] [PATCH v3 2/2] cam: capture_script: Check parseFrames() return value for errors

paul.elder at ideasonboard.com paul.elder at ideasonboard.com
Mon Aug 8 12:31:49 CEST 2022


Hi Daniel,

On Mon, Jun 27, 2022 at 02:28:06PM +0200, Daniel Semkowicz via libcamera-devel wrote:
> parseFrames() return value was ignored. If there was an error during
> frame parsing, parsing was not stopped correctly.
> 
> Signed-off-by: Daniel Semkowicz <dse at thaumatec.com>

Reviewed-by: Paul Elder <paul.elder at ideasonboard.com>

> ---
>  src/cam/capture_script.cpp | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/cam/capture_script.cpp b/src/cam/capture_script.cpp
> index 6278a152..695de37b 100644
> --- a/src/cam/capture_script.cpp
> +++ b/src/cam/capture_script.cpp
> @@ -150,7 +150,9 @@ int CaptureScript::parseScript(FILE *script)
>  		std::string section = eventScalarValue(event);
>  
>  		if (section == "frames") {
> -			parseFrames();
> +			ret = parseFrames();
> +			if (ret)
> +				return ret;
>  		} else {
>  			std::cerr << "Unsupported section '" << section << "'"
>  				  << std::endl;
> -- 
> 2.34.1
> 


More information about the libcamera-devel mailing list