mirror of
https://github.com/brl/mutter.git
synced 2024-11-12 17:27:03 -05: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;
|
||||
|
||||
case CLUTTER_PATH_CURVE_TO:
|
||||
_clutter_bezier_advance (node->bezier,
|
||||
point_distance * CLUTTER_BEZIER_MAX_LENGTH
|
||||
/ node->length,
|
||||
position);
|
||||
if (node->length == 0)
|
||||
*position = node->k.points[2];
|
||||
else
|
||||
{
|
||||
_clutter_bezier_advance (node->bezier,
|
||||
point_distance * CLUTTER_BEZIER_MAX_LENGTH
|
||||
/ node->length,
|
||||
position);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user