Skip to content

Commit f038ff4

Browse files
author
Oleg Sh
committed
Fix wrong iterator usage. Fix potential crash.
1 parent 1ee94db commit f038ff4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

algorithm/MaxFlowPushRelableImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ template<class WeightTypeInterface, typename WeightType> void MaxFlowPushRelabel
385385

386386
_flowValue.erase(last, _flowValue.end());
387387

388-
for(auto element = _flowValue.begin(); element != last; element++)
388+
for(auto element = _flowValue.begin(); element != _flowValue.end(); element++)
389389
{
390390
element->value = 0;
391391
for (auto comapare = flowValueCopy.begin(); comapare != flowValueCopy.end(); comapare++)

common/ConsoleParams.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ void ConsoleParams::ParseCommandLine (const std::vector<String>& params, Paramet
2929
{
3030
commands[GetRealParamName(*param)] = *(param + 1);
3131
}
32+
else
33+
{
34+
break;
35+
}
3236
}
3337
}
3438
}

0 commit comments

Comments
 (0)