Skip to content

Commit c6b63e0

Browse files
committed
calib3d/imgproc: add GCGraph::maxFlow() missing empty checks
1 parent 969b550 commit c6b63e0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

modules/imgproc/src/gcgraph.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ void GCGraph<TWeight>::addTermWeights( int i, TWeight sourceW, TWeight sinkW )
152152
template <class TWeight>
153153
TWeight GCGraph<TWeight>::maxFlow()
154154
{
155+
CV_Assert(!vtcs.empty());
156+
CV_Assert(!edges.empty());
155157
const int TERMINAL = -1, ORPHAN = -2;
156158
Vtx stub, *nilNode = &stub, *first = nilNode, *last = nilNode;
157159
int curr_ts = 0;

0 commit comments

Comments
 (0)