[libcamera-devel,v2,1/3] ipa: raspberrypi: fix bin_x calculation
diff mbox series

Message ID 20201007131812.2688973-2-tomi.valkeinen@iki.fi
State Accepted
Headers show
Series
  • ipa: raspberrypi: fix uninit variables
Related show

Commit Message

Tomi Valkeinen Oct. 7, 2020, 1:18 p.m. UTC
I presume this code is supposed to set bin_x and bin_y, and not bin_y
two times. This caused use of uninitialized variable later when bin_x
was used.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
---
 src/ipa/raspberrypi/raspberrypi.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp
index b0c7d1c..48a72dd 100644
--- a/src/ipa/raspberrypi/raspberrypi.cpp
+++ b/src/ipa/raspberrypi/raspberrypi.cpp
@@ -178,7 +178,7 @@  void IPARPi::setMode(const CameraSensorInfo &sensorInfo)
 	 *
 	 * \todo Get the pipeline handle to provide the full data
 	 */
-	mode_.bin_y = std::min(2, static_cast<int>(mode_.scale_x));
+	mode_.bin_x = std::min(2, static_cast<int>(mode_.scale_x));
 	mode_.bin_y = std::min(2, static_cast<int>(mode_.scale_y));
 
 	/* The noise factor is the square root of the total binning factor. */