Merge pull request #1556 from noahmetzger/winfix

Fixed CID 1164537 (possible division by zero)
This commit is contained in:
zdenop 2018-05-03 17:45:24 +02:00 committed by GitHub
commit c3ed6f0360
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1339,6 +1339,8 @@ bool ColPartition::HasGoodBaseline() {
width = last_pt.x() - first_pt.x();
}
// Maximum median error allowed to be a good text line.
if (height_count == 0)
return false;
double max_error = kMaxBaselineError * total_height / height_count;
ICOORD start_pt, end_pt;
double error = linepoints.Fit(&start_pt, &end_pt);