mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-06 09:17:49 +08:00
Merge pull request #1556 from noahmetzger/winfix
Fixed CID 1164537 (possible division by zero)
This commit is contained in:
commit
c3ed6f0360
@ -1339,6 +1339,8 @@ bool ColPartition::HasGoodBaseline() {
|
|||||||
width = last_pt.x() - first_pt.x();
|
width = last_pt.x() - first_pt.x();
|
||||||
}
|
}
|
||||||
// Maximum median error allowed to be a good text line.
|
// Maximum median error allowed to be a good text line.
|
||||||
|
if (height_count == 0)
|
||||||
|
return false;
|
||||||
double max_error = kMaxBaselineError * total_height / height_count;
|
double max_error = kMaxBaselineError * total_height / height_count;
|
||||||
ICOORD start_pt, end_pt;
|
ICOORD start_pt, end_pt;
|
||||||
double error = linepoints.Fit(&start_pt, &end_pt);
|
double error = linepoints.Fit(&start_pt, &end_pt);
|
||||||
|
Loading…
Reference in New Issue
Block a user