Uninitialized values (and ITK setters) in `otb::ImageToGenericRSOutputParameters`
Description
When itkSetMacro()
is used with member-data left uninitialized in their constructors, quality related tools will emit error/warning messages.
Steps to reproduce
It's for instance the case for valgrind that'll barks things like
==26964== Conditional jump or move depends on uninitialised value(s)
==26964== at 0x34B56F4D: operator!= (itkSize.h:145)
==26964== by 0x34B56F4D: SetOutputSize (otbImageToGenericRSOutputParameters.h:106)
==26964== by 0x34B56F4D: otb::ImageToGenericRSOutputParameters<otb::VectorImage<float, 2u> >::EstimateOutputSize() (otbImageToGenericRSOutputParameters.hxx:249)
==26964== by 0x34B5CAE4: otb::ImageToGenericRSOutputParameters<otb::VectorImage<float, 2u> >::Compute() (otbImageToGenericRSOutputParameters.hxx:66)
==26964== by 0x34B5D137: otb::Wrapper::OrthoRectification::DoUpdateParameters() (otbOrthoRectification.cxx:285)
==26964== by 0x2D034A93: otb::Wrapper::Application::UpdateParameters() (otbWrapperApplication.cxx:490)
Proposed resolution
I've identified the issue in otb::ImageToGenericRSOutputParameters
class, where it could be fixed with
PointType m_OutputOrigin{0.0};
SpacingType m_OutputSpacing{0.0};
SizeType m_OutputSize{0, 0};
(IMO, the easiest is to use C++11 member initialization given we have these setters; and unfortunately ITK constructors prevents zero-initialisation with empty braces.)
I haven't checked whether it happens elsewhere.
Edited by Luc Hermitte