Fixed small compilation warning that could have lead to memory corruption

Merged Sebastien Ponce requested to merge FixCompilationWarningMaster into master

Backport of !574 (merged) to the master branch

Merge request reports