Skip to content

Commit bfe2a79

Browse files
committed
Fix CID 1164566 (Dereference after null check)
Signed-off-by: Stefan Weil <[email protected]>
1 parent 036c72c commit bfe2a79

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wordrec/language_model.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -575,9 +575,9 @@ bool LanguageModel::AddViterbiStateEntry(
575575
else
576576
tprintf("\n");
577577
}
578+
ASSERT_HOST(curr_state != nullptr);
578579
// Check whether the list is full.
579-
if (curr_state != nullptr &&
580-
curr_state->viterbi_state_entries_length >=
580+
if (curr_state->viterbi_state_entries_length >=
581581
language_model_viterbi_list_max_size) {
582582
if (language_model_debug_level > 1) {
583583
tprintf("AddViterbiStateEntry: viterbi list is full!\n");

0 commit comments

Comments
 (0)