From 8201093830845f1ce420b8ca1dc550cd5a421b26 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Thu, 18 Feb 2021 13:47:52 +0000 Subject: 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 Acked-by: Jacopo Mondi Reviewed-by: Paul Elder Signed-off-by: Kieran Bingham --- src/libcamera/pipeline/ipu3/ipu3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libcamera/pipeline/ipu3') 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) -- cgit v1.2.1