summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2013-07-26 12:31:14 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2013-07-26 12:31:14 +0200
commit35549dbd8b5ee97424a211411ed1a3af4f95e742 (patch)
treed2b516073b02d8c357345020c1865ea6ec5f829c /bin
parent9eb6907963360f65ba2d538add0a03d0fd181991 (diff)
downloadlibuca-35549dbd8b5ee97424a211411ed1a3af4f95e742.tar.gz
libuca-35549dbd8b5ee97424a211411ed1a3af4f95e742.tar.bz2
libuca-35549dbd8b5ee97424a211411ed1a3af4f95e742.tar.xz
libuca-35549dbd8b5ee97424a211411ed1a3af4f95e742.zip
Fix SIGFPE
Diffstat (limited to 'bin')
-rw-r--r--bin/gui/control.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/gui/control.c b/bin/gui/control.c
index b8023f7..8b51cc6 100644
--- a/bin/gui/control.c
+++ b/bin/gui/control.c
@@ -413,7 +413,8 @@ update_current_frame (ThreadData *data)
n_max = ring_buffer_get_num_blocks (data->buffer);
/* Shift index so that we always show the oldest frames first */
- index = (index + data->n_recorded - n_max) % n_max;
+ if (n_max > 0)
+ index = (index + data->n_recorded - n_max) % n_max;
ring_buffer_set_current_pointer (data->buffer, index);