From dbd2e30ee3bfd1dded8048693d577dded664d05b Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 18 Nov 2021 16:42:16 +0000 Subject: pipeline: raspberrypi: Avoid invalid PixelFormat warning message PixelFormatInfo::info() would log a warning message if the PixelFormat was invalid when called from the isRaw() function. Add a validity test in isRaw() to avoid this warning message. Signed-off-by: Naushir Patuck Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham Signed-off-by: Kieran Bingham --- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/libcamera/pipeline/raspberrypi/raspberrypi.cpp') diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 4f6c699a..ad526a8b 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -102,6 +102,9 @@ bool isRaw(const PixelFormat &pixFmt) * The isRaw test might be redundant right now the pipeline handler only * supports RAW sensors. Leave it in for now, just as a sanity check. */ + if (!pixFmt.isValid()) + return false; + const PixelFormatInfo &info = PixelFormatInfo::info(pixFmt); if (!info.isValid()) return false; -- cgit v1.2.1