PyGaze icon indicating copy to clipboard operation
PyGaze copied to clipboard

Event detection: potential division by 0

Open esdalmaijer opened this issue 9 years ago • 0 comments

Two time stamps are subtracted from each other, and then a distance is divided by the time difference. If the time difference is zero, the result is a crash.

See: https://github.com/esdalmaijer/PyGaze/blob/master/pygaze/_eyetracker/libeyetribe.py#L967 (and in a few lines around there).

Solution: check whether time has passed, and only proceed if t1-t0 > 0.

esdalmaijer avatar Apr 22 '16 15:04 esdalmaijer