Fix issue detected by Coverity Scan

CID: 1340285 (Division or modulo by zero)

Signed-off-by: Noah Metzger <noah.metzger@bib.uni-mannheim.de>
This commit is contained in:
Noah Metzger 2018-08-01 15:54:50 +02:00
parent d28631a274
commit 65997bed16

View File

@ -926,7 +926,8 @@ void ColumnFinder::ComputeMeanColumnGap(bool any_multi_column) {
&gap_samples);
}
mean_column_gap_ = any_multi_column && gap_samples > 0
? total_gap / gap_samples : total_width / width_samples;
? total_gap / gap_samples : width_samples > 0
? total_width / width_samples : 0;
}
//////// Functions that manipulate ColPartitions in the part_grid_ /////