mirror of
https://github.com/brl/mutter.git
synced 2025-04-10 04:09:38 +00:00
Prevent a possible zero division
A zero division might occur in clutter_path_get_position if the length of a curved node is zero. Signed-off-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
parent
56ac4baf17
commit
5c50be1bdc
@ -1421,10 +1421,15 @@ clutter_path_get_position (ClutterPath *path,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CLUTTER_PATH_CURVE_TO:
|
case CLUTTER_PATH_CURVE_TO:
|
||||||
_clutter_bezier_advance (node->bezier,
|
if (node->length == 0)
|
||||||
point_distance * CLUTTER_BEZIER_MAX_LENGTH
|
*position = node->k.points[2];
|
||||||
/ node->length,
|
else
|
||||||
position);
|
{
|
||||||
|
_clutter_bezier_advance (node->bezier,
|
||||||
|
point_distance * CLUTTER_BEZIER_MAX_LENGTH
|
||||||
|
/ node->length,
|
||||||
|
position);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user