@@ -299,6 +299,13 @@ void IPASoftSimple::processStats(const uint32_t frame,
[[maybe_unused]] const uint32_t bufferId,
const ControlList &sensorControls)
{
+ /* Sanity check */
+ if (!sensorControls.contains(V4L2_CID_EXPOSURE) ||
+ !sensorControls.contains(V4L2_CID_ANALOGUE_GAIN)) {
+ LOG(IPASoft, Error) << "Control(s) missing";
+ return;
+ }
+
IPAFrameContext &frameContext = context_.frameContexts.get(frame);
frameContext.sensor.exposure =
@@ -311,13 +318,6 @@ void IPASoftSimple::processStats(const uint32_t frame,
algo->process(context_, frame, frameContext, stats_, metadata);
metadataReady.emit(frame, metadata);
- /* Sanity check */
- if (!sensorControls.contains(V4L2_CID_EXPOSURE) ||
- !sensorControls.contains(V4L2_CID_ANALOGUE_GAIN)) {
- LOG(IPASoft, Error) << "Control(s) missing";
- return;
- }
-
ControlList ctrls(sensorInfoMap_);
auto &againNew = frameContext.sensor.gain;
Check existence before the values are retrieved. Link: https://gitlab.freedesktop.org/camera/libcamera/-/work_items/241 Fixes: fb8ad13dc3e3 ("libcamera: software_isp: Move exposure+gain to an algorithm module") Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> --- src/ipa/simple/soft_simple.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)