From: Alexander Alekhin Date: Thu, 1 Oct 2020 15:20:32 +0000 (+0000) Subject: calib3d/imgproc: add GCGraph::maxFlow() missing empty checks X-Git-Tag: submit/tizen/20210224.033012~2^2~15^2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c6b63e0e28001e0def94850feaa8c8851769ce92;p=platform%2Fupstream%2Fopencv.git calib3d/imgproc: add GCGraph::maxFlow() missing empty checks --- diff --git a/modules/imgproc/src/gcgraph.hpp b/modules/imgproc/src/gcgraph.hpp index 16c25de..8730e1f 100644 --- a/modules/imgproc/src/gcgraph.hpp +++ b/modules/imgproc/src/gcgraph.hpp @@ -152,6 +152,8 @@ void GCGraph::addTermWeights( int i, TWeight sourceW, TWeight sinkW ) template TWeight GCGraph::maxFlow() { + CV_Assert(!vtcs.empty()); + CV_Assert(!edges.empty()); const int TERMINAL = -1, ORPHAN = -2; Vtx stub, *nilNode = &stub, *first = nilNode, *last = nilNode; int curr_ts = 0;