Fix SIGFPE on some fonts when calculating their average width on Haiku
* src/haiku_font_support.cc (estimate_font_ascii): Avoid divison by zero.
This commit is contained in:
@@ -68,7 +68,11 @@ estimate_font_ascii (BFont *font, int *max_width,
|
||||
|
||||
*min_width = min;
|
||||
*max_width = max;
|
||||
*avg_width = total / count;
|
||||
|
||||
if (count)
|
||||
*avg_width = total / count;
|
||||
else
|
||||
*avg_width = 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user