From d8848693bf92c15a4ce18a3ff8b43f537de5e033 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Sun, 28 Jun 2020 18:03:32 +0200 Subject: libcamera: raspberrypi: Fail on unsupported stream role MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When an unsupported stream roles is requested to generateConfiguration(), the function shall fail instead of simply ignoring the request. Reviewed-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Signed-off-by: Jacopo Mondi --- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libcamera/pipeline/raspberrypi') diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index b3cb9323..9d887b70 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -568,7 +568,8 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera, default: LOG(RPI, Error) << "Requested stream role not supported: " << role; - break; + delete config; + return nullptr; } if (rawCount > 1 || outCount > 2) { -- cgit v1.2.1