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>
This commit is contained in:
Kieran Bingham
2021-02-18 13:47:52 +00:00
parent b147de2553
commit 8201093830

View File

@@ -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)