Skip to content

Commit

Permalink
Initialize output parameters of word_char_quality() to zero before ea…
Browse files Browse the repository at this point in the history
…rly exit
  • Loading branch information
ceisserer committed Sep 2, 2015
1 parent 73b2898 commit 0fd4134
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ccmain/docqual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,11 @@ void Tesseract::word_char_quality(WERD_RES *word,
inT16 *match_count,
inT16 *accepted_match_count) {
if (word->bln_boxes == NULL ||
word->rebuild_word == NULL || word->rebuild_word->blobs.empty())
word->rebuild_word == NULL || word->rebuild_word->blobs.empty()) {
*match_count = 0;

This comment has been minimized.

Copy link
@peirick

peirick Oct 22, 2015

maybe it's better to initialize the out values over early exit branch and check if they are not nullptr.

*accepted_match_count = 0;
return;
}

DocQualCallbacks cb(word);
word->bln_boxes->ProcessMatchedBlobs(
Expand Down

0 comments on commit 0fd4134

Please sign in to comment.