Merge pull request #1811 from noahmetzger/winfix

Fix issue reported by Coverity Scan
This commit is contained in:
zdenop 2018-07-31 09:53:33 +02:00 committed by GitHub
commit 7d99cb4e28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2027,7 +2027,7 @@ void Tesseract::set_word_fonts(WERD_RES *word) {
if (score1 > 0) {
const FontInfo fi = fontinfo_table_.get(font_id1);
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",
fi.name, word->fontinfo_id_count,
fontinfo_table_.get(font_id2).name,