Skip to content

Commit

Permalink
Merge pull request #3790 from masterAllen:fix_OCRBeamSearchDecoder
Browse files Browse the repository at this point in the history
Fix OCRBeamSearchDecoder bug: a risk of assigning value to NULL.
  • Loading branch information
asmorkalov authored Sep 18, 2024
2 parents 0377a6a + ed10e2d commit 80f1ca2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions modules/text/src/ocr_beamsearch_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,12 @@ class OCRBeamSearchDecoderImpl CV_FINAL : public OCRBeamSearchDecoder
double lp = score_segmentation( beam[0].segmentation, out_sequence );

// fill other (dummy) output parameters
component_rects->push_back(Rect(0,0,src.cols,src.rows));
component_texts->push_back(out_sequence);
component_confidences->push_back((float)exp(lp));
if (component_rects != NULL)
component_rects->push_back(Rect(0,0,src.cols,src.rows));
if (component_texts != NULL)
component_texts->push_back(out_sequence);
if (component_confidences != NULL)
component_confidences->push_back((float)exp(lp));

return;
}
Expand Down

0 comments on commit 80f1ca2

Please sign in to comment.