summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2021-02-18 13:47:52 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2021-02-19 13:58:49 +0000
commit8201093830845f1ce420b8ca1dc550cd5a421b26 (patch)
treeeeefe485e94d86c1b9aa0535ad40f10130d25948
parentb147de25537652f8dabf40d5165350dad083a28a (diff)
libcamera: pipeline: ipu3: Prevent unintialised memory use
The call to setFormat uses uninitialised data, which, could cause unwanted effects. It is also trapped and reported by valgrind. Initialise the V4L2SubdeviceFormat structure correctly before use. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Acked-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r--src/libcamera/pipeline/ipu3/ipu3.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index 3e6b88af..e2353e89 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -846,7 +846,7 @@ int PipelineHandlerIPU3::initControls(IPU3CameraData *data)
*/
/* Re-fetch the sensor info updated to use the largest resolution. */
- V4L2SubdeviceFormat sensorFormat;
+ V4L2SubdeviceFormat sensorFormat = {};
sensorFormat.size = sensor->resolution();
ret = sensor->setFormat(&sensorFormat);
if (ret)