mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-20 15:59:11 +08:00
Fix CID 1400763 Using invalid iterator (fixes issue #2806)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
cdd19d561b
commit
255d7c9675
@ -432,7 +432,8 @@ ChoiceIterator::~ChoiceIterator() {
|
||||
// are none left.
|
||||
bool ChoiceIterator::Next() {
|
||||
if (oemLSTM_ && LSTM_choices_ != nullptr && !LSTM_choices_->empty()) {
|
||||
if (LSTM_choice_it_ != LSTM_choices_->end() && next(LSTM_choice_it_) == LSTM_choices_->end()) {
|
||||
if (LSTM_choice_it_ == LSTM_choices_->end() ||
|
||||
next(LSTM_choice_it_) == LSTM_choices_->end()) {
|
||||
return false;
|
||||
} else {
|
||||
++LSTM_choice_it_;
|
||||
|
Loading…
Reference in New Issue
Block a user