[libcamera-devel] [PATCH 3/4] libcamera: pipeline: simple: return from match() on error
Tomi Valkeinen
tomi.valkeinen at iki.fi
Thu Oct 22 10:17:30 CEST 2020
If converter_->open() fails, the code deletes the converter_ but then
happily goes on, and at the very next lines will use converter_.
I assume the intention is to return from the function with false.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen at iki.fi>
---
src/libcamera/pipeline/simple/simple.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
index 0d48e1b6..df93bc8d 100644
--- a/src/libcamera/pipeline/simple/simple.cpp
+++ b/src/libcamera/pipeline/simple/simple.cpp
@@ -774,6 +774,7 @@ bool SimplePipelineHandler::match(DeviceEnumerator *enumerator)
<< "Failed to open converter, disabling format conversion";
delete converter_;
converter_ = nullptr;
+ return false;
}
converter_->bufferReady.connect(this, &SimplePipelineHandler::converterDone);
--
2.25.1
More information about the libcamera-devel
mailing list