Commit 3adc2c40 authored by Marcus Lundblad's avatar Marcus Lundblad
Browse files

scale: Avoid overflowing float multiplication

Declare local variable m_per_pixels as double
to avoid potential overflow when promoting the
result when muliplying with a float value passing
the result to "log" (double precision).
parent ea8609d1
......@@ -93,7 +93,7 @@ shumate_scale_compute_length (ShumateScale *self,
float base;
float factor;
gboolean is_small_unit = TRUE;
float m_per_pixel;
double m_per_pixel;
g_assert (SHUMATE_IS_SCALE (self));
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment