diff --git a/Code/Learning/otbSVMModel.txx b/Code/Learning/otbSVMModel.txx index 9f30c2b9001acd3694550b6b1f9c18d4df43b706..59766b00b01a682689751ca5a2640b9d026d3f99 100644 --- a/Code/Learning/otbSVMModel.txx +++ b/Code/Learning/otbSVMModel.txx @@ -84,6 +84,13 @@ SVMModel<TInputPixel, TLabel> otbMsgDevMacro( << "SVMModel::AllocateProblem - x done" ); delete [] m_XSpace; m_XSpace = new struct svm_node[elements]; + + for(unsigned int i = 0;i<elements;++i) + { + m_XSpace[i].value = 0; + m_XSpace[i].index = -1; + } + //free(m_XSpace); //m_XSpace = Malloc(struct svm_node,elements); //otbMsgDevMacro( << "SVMModel::AllocateProblem - m_XSpace done" );