Skip to content

Commit 69a894c

Browse files
committed
pipeline: rpi: Fix invalid access to CameraData::sensorInfo_
sensorInfo_ currently gets populated in configureIPA(), but is possibly referenced in platformConfigure() which is called first. Fix this by populating sensorInfo_ straight after configuring the sensor in configure(), ensuring the fields are valid in the call to platformConfigure(). Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
1 parent 48fe316 commit 69a894c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/libcamera/pipeline/rpi/common/pipeline_base.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,13 @@ int PipelineHandlerBase::configure(Camera *camera, CameraConfiguration *config)
529529
if (ret)
530530
return ret;
531531

532+
/* We store the IPACameraSensorInfo for digital zoom calculations. */
533+
ret = data->sensor_->sensorInfo(&data->sensorInfo_);
534+
if (ret) {
535+
LOG(RPI, Error) << "Failed to retrieve camera sensor info";
536+
return ret;
537+
}
538+
532539
/*
533540
* Platform specific internal stream configuration. This also assigns
534541
* external streams which get configured below.
@@ -1201,13 +1208,6 @@ int CameraData::configureIPA(const CameraConfiguration *config, ipa::RPi::Config
12011208
if (ret)
12021209
return ret;
12031210

1204-
/* We store the IPACameraSensorInfo for digital zoom calculations. */
1205-
ret = sensor_->sensorInfo(&sensorInfo_);
1206-
if (ret) {
1207-
LOG(RPI, Error) << "Failed to retrieve camera sensor info";
1208-
return ret;
1209-
}
1210-
12111211
/* Always send the user transform to the IPA. */
12121212
Transform transform = config->orientation / Orientation::Rotate0;
12131213
params.transform = static_cast<unsigned int>(transform);

0 commit comments

Comments
 (0)