elementary: fix potential divide by zero in els_scroller.c

SVN revision: 80124
This commit is contained in:
Cedric BAIL 2012-12-04 03:51:18 +00:00
parent ba3a32d45a
commit 8e35c17f40
3 changed files with 10 additions and 3 deletions

View File

@ -742,4 +742,8 @@
2012-12-02 Mike Blumenkrantz
* Fix case where tooltips could go offscreen unnecessarily
* Fix case where tooltips could go offscreen unnecessarily.
2012-12-04 Cedric Bail
* Fix a possible divide by zero in els_scroller animator.

View File

@ -71,6 +71,7 @@ Fixes:
* Fix the naviframe to resize it's items which are inserted.
* Fix the naviframe to send signal emits one time for content show/hide, text show/hide.
* Fix case where tooltips could go offscreen unnecessarily
* Fix possible divide by zero in els_scroller animator.
Removals:

View File

@ -2124,14 +2124,16 @@ _smart_hold_animator(void *data)
while ((pos[src_index].t < time_interval * i) && (src_index <= count))
{
src_index++;
}
}
if (src_index <= count)
{
{
xsum += pos[src_index].x;
ysum += pos[src_index].y;
dst_index++;
}
}
/* Note: difficult to trigger, but may be possible to get src_index == 0 and count < 0 and so trigger a divide by zero. */
if (!dst_index) dst_index = 1;
fx = xsum / dst_index;
fy = ysum / dst_index;
}