Fix issue reported by Coverity Scan

CID: 1391264 (Improper use of negative value)

Signed-off-by: Noah Metzger <noah.metzger@bib.uni-mannheim.de>
This commit is contained in:
Noah Metzger 2018-07-31 09:43:30 +02:00
parent 91c7504a35
commit 83a4eb3b44

View File

@ -2027,7 +2027,7 @@ void Tesseract::set_word_fonts(WERD_RES *word) {
if (score1 > 0) { if (score1 > 0) {
const FontInfo fi = fontinfo_table_.get(font_id1); const FontInfo fi = fontinfo_table_.get(font_id1);
if (tessedit_debug_fonts) { if (tessedit_debug_fonts) {
if (word->fontinfo_id2_count > 0) { if (word->fontinfo_id2_count > 0 && font_id2 >= 0) {
tprintf("Word modal font=%s, score=%d, 2nd choice %s/%d\n", tprintf("Word modal font=%s, score=%d, 2nd choice %s/%d\n",
fi.name, word->fontinfo_id_count, fi.name, word->fontinfo_id_count,
fontinfo_table_.get(font_id2).name, fontinfo_table_.get(font_id2).name,