diff options
author | Naushir Patuck <naush@raspberrypi.com> | 2023-05-23 13:02:08 +0100 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2023-05-24 21:59:20 +0100 |
commit | 58f38082e14c79a16b0b6373c14b0e56c8ac15bc (patch) | |
tree | c8bc5a5abdbbd4273e6e2cd589b9609f645c6db7 /src/libcamera/pipeline/rpi/common/pipeline_base.cpp | |
parent | 7d5b38e2ef413ebdf8fc333b8b9814cf34ac3bf7 (diff) |
pipeline: rpi: ipa_base: Parse config files after platformRegister()
If a user uses a pipeline handler config file where a custom timeout
value is specified, it would lead to a segmentation fault when
loadPipelineConfiguration() tried to access the as yet uninitialised
V4L2VideoDevice object.
To fix this, parse the pipeline handler config file only after fully
initialising and registering the pipeline handler and V4L2VideoDevice
objects.
Fixes: 6c71ee1f15305 ("pipeline: raspberrypi: Introduce PipelineHandlerBase class")
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/libcamera/pipeline/rpi/common/pipeline_base.cpp')
-rw-r--r-- | src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp index ba1797bc..3bb5ec53 100644 --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp @@ -888,16 +888,16 @@ int PipelineHandlerBase::registerCamera(std::unique_ptr<RPi::CameraData> &camera } data->nativeBayerOrder_ = bayerFormat.order; + ret = platformRegister(cameraData, frontend, backend); + if (ret) + return ret; + ret = data->loadPipelineConfiguration(); if (ret) { LOG(RPI, Error) << "Unable to load pipeline configuration"; return ret; } - ret = platformRegister(cameraData, frontend, backend); - if (ret) - return ret; - /* Setup the general IPA signal handlers. */ data->frontendDevice()->dequeueTimeout.connect(data, &RPi::CameraData::cameraTimeout); data->frontendDevice()->frameStart.connect(data, &RPi::CameraData::frameStarted); |