[libcamera-devel] [PATCH 4/4] ipa: raspberrypi: fix use of uninitialized fields
Kieran Bingham
kieran.bingham at ideasonboard.com
Wed Oct 7 14:47:20 CEST 2020
Hi Tomi,
On 07/10/2020 12:07, Tomi Valkeinen wrote:
> These fields are not initialized, but are used. Set them to 0.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen at iki.fi>
> ---
> src/ipa/raspberrypi/controller/rpi/agc.hpp | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/ipa/raspberrypi/controller/rpi/agc.hpp b/src/ipa/raspberrypi/controller/rpi/agc.hpp
> index ba7ae09..23374d5 100644
> --- a/src/ipa/raspberrypi/controller/rpi/agc.hpp
> +++ b/src/ipa/raspberrypi/controller/rpi/agc.hpp
> @@ -116,9 +116,9 @@ private:
> std::string exposure_mode_name_;
> std::string constraint_mode_name_;
> double ev_;
> - double flicker_period_;
> - double fixed_shutter_;
> - double fixed_analogue_gain_;
> + double flicker_period_ = 0;
= 0.0; ?
Also - this is setting the initialisation in the header definition,
rather than the implementation where we would normally do the
initialisation. Any reason for that?
> + double fixed_shutter_ = 0;
> + double fixed_analogue_gain_ = 0;
These get initialised in Agc::Agc(Controller *controller) ...
Oh - wait, I see you've removed that in patch 2/4!
So technically this is a defect introduced by patch 2/4 - so perhaps it
should be squashed there in some form or another.
> };
>
> } // namespace RPiController
>
--
Regards
--
Kieran
More information about the libcamera-devel
mailing list