forked from enlightenment/efl
From: Patryk Kaczmarek <patryk.k@samsung.com>
Subject: [E-devel] [Patch] [Ecore] Protection for giving below zero values for ecore_poll and ecore_timer Please also check attached patch for ecore_timer_interval_set and ecore_poller_poll_interval_set. It checks if given time is not zero or below zero. SVN revision: 76805
This commit is contained in:
parent
042ecacd0f
commit
cc72c09b84
|
@ -194,6 +194,13 @@ ecore_poller_poll_interval_set(Ecore_Poller_Type type __UNUSED__,
|
|||
double poll_time)
|
||||
{
|
||||
EINA_MAIN_LOOP_CHECK_RETURN;
|
||||
|
||||
if (poll_time < 0.0)
|
||||
{
|
||||
ERR("Poll time %f less than zero, ignored", poll_time);
|
||||
return;
|
||||
}
|
||||
|
||||
poll_interval = poll_time;
|
||||
_ecore_poller_next_tick_eval();
|
||||
}
|
||||
|
|
|
@ -233,6 +233,12 @@ ecore_timer_interval_set(Ecore_Timer *timer,
|
|||
EINA_MAIN_LOOP_CHECK_RETURN;
|
||||
_ecore_lock();
|
||||
|
||||
if (in < 0.0)
|
||||
{
|
||||
ERR("Interval %f less than zero, ignored", in);
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER))
|
||||
{
|
||||
ECORE_MAGIC_FAIL(timer, ECORE_MAGIC_TIMER,
|
||||
|
|
Loading…
Reference in New Issue