Fix uninitialized memory reads and memory leaks in StereoGC

pull/3414/head
Roman Donchenko 10 years ago
parent e05a0bc6c5
commit 7d8e5f623a
  1. 5
      modules/legacy/src/stereogc.cpp

@ -157,7 +157,10 @@ static int64 icvGCMaxFlow( GCVtx* vtx, int nvtx, GCEdge* edges, GCVtx**& _orphan
v->t = v->weight < 0;
}
else
{
v->next = NULL;
v->parent = 0;
}
}
first = first->next;
@ -396,6 +399,8 @@ void cvReleaseStereoGCState( CvStereoGCState** _state )
cvReleaseMat( &state->right );
cvReleaseMat( &state->ptrLeft );
cvReleaseMat( &state->ptrRight );
cvReleaseMat( &state->dispLeft );
cvReleaseMat( &state->dispRight );
cvReleaseMat( &state->vtxBuf );
cvReleaseMat( &state->edgeBuf );
cvFree( _state );

Loading…
Cancel
Save