summaryrefslogtreecommitdiffstats
path: root/src/cameras/dummy.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-03-17 16:42:26 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-03-17 16:42:26 +0100
commitaec30c85d341e12987db743d880349dbb419eec6 (patch)
treece1a75be83c769a320a68a062b0cf0adc20b252d /src/cameras/dummy.c
parent16c7e3285cd16e1f05055a1cc6cc149a66d138de (diff)
downloaduca-aec30c85d341e12987db743d880349dbb419eec6.tar.gz
uca-aec30c85d341e12987db743d880349dbb419eec6.tar.bz2
uca-aec30c85d341e12987db743d880349dbb419eec6.tar.xz
uca-aec30c85d341e12987db743d880349dbb419eec6.zip
Fix potential division by zero bug
Diffstat (limited to 'src/cameras/dummy.c')
-rw-r--r--src/cameras/dummy.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cameras/dummy.c b/src/cameras/dummy.c
index 3c1964f..1a7b275 100644
--- a/src/cameras/dummy.c
+++ b/src/cameras/dummy.c
@@ -3,6 +3,7 @@
#define __USE_BSD
#include <unistd.h>
#undef __USE_BSD
+#include <assert.h>
#include "config.h"
#include "uca.h"
@@ -124,6 +125,7 @@ static void *uca_dummy_grab_thread(void *arg)
struct uca_camera *cam = ((struct uca_camera *) arg);
struct dummy_cam *dc = GET_DUMMY(cam);
+ assert(dc->frame_rate > 0);
const __useconds_t sleep_time = (unsigned int) 1000000.0f / dc->frame_rate;
while (dc->thread_running) {