summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/controller
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@iki.fi>2020-10-07 16:18:11 +0300
committerKieran Bingham <kieran.bingham@ideasonboard.com>2020-10-07 14:46:38 +0100
commit5fbda0dfda8dbf85022356e117fff47b184461f6 (patch)
treefed3c1beed2d223bc213b8f8eb798c2cba7b8d88 /src/ipa/raspberrypi/controller
parent5f1f3092a1bedaec36fa98f9c6476fb48f70f931 (diff)
ipa: raspberrypi: fix access to uninitialized variables
Set span_r and span_b to -1 so that when they are passed to Pwl::Eval() they won't cause access to uninitialized memory. 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> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/ipa/raspberrypi/controller')
-rw-r--r--src/ipa/raspberrypi/controller/rpi/awb.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp
index a5536e47..469d0e53 100644
--- a/src/ipa/raspberrypi/controller/rpi/awb.cpp
+++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp
@@ -430,7 +430,7 @@ double Awb::coarseSearch(Pwl const &prior)
void Awb::fineSearch(double &t, double &r, double &b, Pwl const &prior)
{
- int span_r, span_b;
+ int span_r = -1, span_b = -1;
config_.ct_r.Eval(t, &span_r);
config_.ct_b.Eval(t, &span_b);
double step = t / 10 * config_.coarse_step * 0.1;