Test for empty choices at ChoiceIterator (fix issue 826)

git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@840 d0cd1f9f-072b-0410-8dd7-cf729c803f20
This commit is contained in:
zdenop@gmail.com 2013-05-02 08:13:22 +00:00
parent 80040b834b
commit 16e80c06ee

View File

@ -321,7 +321,7 @@ ChoiceIterator::ChoiceIterator(const LTRResultIterator& result_it) {
PAGE_RES_IT res_it(*result_it.it_);
WERD_CHOICE* best_choice = word_res_->best_choice;
BLOB_CHOICE_LIST_CLIST* choices = best_choice->blob_choices();
if (choices != NULL) {
if (choices != NULL && !choices->empty()) {
BLOB_CHOICE_LIST_C_IT blob_choices_it(choices);
for (int blob = 0; blob < result_it.blob_index_; ++blob)
blob_choices_it.forward();