Skip to content
Snippets Groups Projects
Commit 83a99880 authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

COV: fix coverity defect REVERSE_INULL

parent f773fd60
No related branches found
No related tags found
No related merge requests found
......@@ -73,10 +73,14 @@ template<class TInputValue, class TOutputValue>
void NeuralNetworkMachineLearningModel<TInputValue, TOutputValue>::LabelsToMat(const TargetListSampleType * labels,
cv::Mat & output)
{
unsigned int nbSamples = labels->Size();
unsigned int nbSamples = 0;
if (labels != NULL)
{
nbSamples = labels->Size();
}
// Check for valid listSample
if (labels != NULL && nbSamples > 0)
if (nbSamples > 0)
{
// Build an iterator
typename TargetListSampleType::ConstIterator labelSampleIt = labels->Begin();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment