mirror of
https://github.com/opencv/opencv.git
synced 2024-11-27 12:40:05 +08:00
Fix uninitialized memory reads and memory leaks in StereoGC
(cherry picked from commit 7d8e5f623a
)
This commit is contained in:
parent
23bf3e337a
commit
1ccd64e102
@ -157,8 +157,11 @@ 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;
|
||||
last->next = nilNode;
|
||||
@ -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…
Reference in New Issue
Block a user