Skip to content

Commit b226275

Browse files
committed
solve segfault for box.train; fixes #57
1 parent ef26b31 commit b226275

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

api/baseapi.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,9 @@ int TessBaseAPI::Recognize(ETEXT_DESC* monitor) {
851851
page_res_ = new PAGE_RES(false,
852852
block_list_, &tesseract_->prev_word_best_choice_);
853853
}
854+
if (page_res_ == NULL) {
855+
return -1;
856+
}
854857
if (tesseract_->tessedit_make_boxes_from_boxes) {
855858
tesseract_->CorrectClassifyWords(page_res_);
856859
return 0;

0 commit comments

Comments
 (0)