Skip to content

Commit

Permalink
Fix issue reported by Coverity Scan
Browse files Browse the repository at this point in the history
CID: 1391264 (Improper use of negative value)

Signed-off-by: Noah Metzger <[email protected]>
  • Loading branch information
noahmetzger committed Jul 31, 2018
1 parent 91c7504 commit 83a4eb3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ccmain/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 83a4eb3

Please sign in to comment.