summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2020-10-23 10:59:12 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2020-10-27 14:48:46 +0000
commit7adf3a069839c1b2c440b07ca2911ffc2d39e816 (patch)
tree1eec7de5aac745d8df51d3c4c6ef30fdad849c4a
parent7973efcbc03132facdd5dde91074277f63e1c151 (diff)
libcamera: pipeline: simple: Only connect created converters
If converter_->open() fails, the code deletes the converter_ but then happily goes on, and at the very next lines will use converter_ to connect the bufferReady signal. Ensure the converter is only connected when successfully opened by extending the conditional and connecting in an else scope instead. Reported-by: Tomi Valkeinen <tomi.valkeinen@iki.fi> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--src/libcamera/pipeline/simple/simple.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
index 0d48e1b6..3d2039f3 100644
--- a/src/libcamera/pipeline/simple/simple.cpp
+++ b/src/libcamera/pipeline/simple/simple.cpp
@@ -774,9 +774,9 @@ bool SimplePipelineHandler::match(DeviceEnumerator *enumerator)
<< "Failed to open converter, disabling format conversion";
delete converter_;
converter_ = nullptr;
+ } else {
+ converter_->bufferReady.connect(this, &SimplePipelineHandler::converterDone);
}
-
- converter_->bufferReady.connect(this, &SimplePipelineHandler::converterDone);
}
/*