forked from enlightenment/efl
elementary: fix potential divide by zero in els_scroller.c
SVN revision: 80124
This commit is contained in:
parent
ba3a32d45a
commit
8e35c17f40
|
@ -742,4 +742,8 @@
|
||||||
|
|
||||||
2012-12-02 Mike Blumenkrantz
|
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.
|
||||||
|
|
|
@ -71,6 +71,7 @@ Fixes:
|
||||||
* Fix the naviframe to resize it's items which are inserted.
|
* 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 the naviframe to send signal emits one time for content show/hide, text show/hide.
|
||||||
* Fix case where tooltips could go offscreen unnecessarily
|
* Fix case where tooltips could go offscreen unnecessarily
|
||||||
|
* Fix possible divide by zero in els_scroller animator.
|
||||||
|
|
||||||
Removals:
|
Removals:
|
||||||
|
|
||||||
|
|
|
@ -2124,14 +2124,16 @@ _smart_hold_animator(void *data)
|
||||||
while ((pos[src_index].t < time_interval * i) && (src_index <= count))
|
while ((pos[src_index].t < time_interval * i) && (src_index <= count))
|
||||||
{
|
{
|
||||||
src_index++;
|
src_index++;
|
||||||
}
|
}
|
||||||
if (src_index <= count)
|
if (src_index <= count)
|
||||||
{
|
{
|
||||||
xsum += pos[src_index].x;
|
xsum += pos[src_index].x;
|
||||||
ysum += pos[src_index].y;
|
ysum += pos[src_index].y;
|
||||||
dst_index++;
|
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;
|
fx = xsum / dst_index;
|
||||||
fy = ysum / dst_index;
|
fy = ysum / dst_index;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue