From aec30c85d341e12987db743d880349dbb419eec6 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Thu, 17 Mar 2011 16:42:26 +0100 Subject: Fix potential division by zero bug --- src/cameras/dummy.c | 2 ++ 1 file changed, 2 insertions(+) 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 #undef __USE_BSD +#include #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) { -- cgit v1.2.3