diff options
author | Bert Münnich <ber.t@posteo.de> | 2014-09-01 20:40:17 +0200 |
---|---|---|
committer | Bert Münnich <ber.t@posteo.de> | 2014-09-01 20:40:17 +0200 |
commit | 95a7496edca2f4cffcb1e01dfa351cb0a42f07c2 (patch) | |
tree | 94ff1f054809764aab26eb22085096e9f2d7c1b2 /commands.c | |
parent | f478385d5997f7c2cd4392a4a20d69c3b57aeabb (diff) | |
download | nsxiv-95a7496edca2f4cffcb1e01dfa351cb0a42f07c2.tar.zst |
Fixed segfault in ci_toggle_animation, fixes issue #173
Diffstat (limited to 'commands.c')
-rw-r--r-- | commands.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -290,13 +290,14 @@ bool ci_toggle_animation(arg_t a) { bool dirty = false; - img.multi.animate = !img.multi.animate; - - if (img.multi.animate) { - dirty = img_frame_animate(&img, true); - set_timeout(animate, img.multi.frames[img.multi.sel].delay, true); - } else { - reset_timeout(animate); + if (img.multi.cnt > 0) { + img.multi.animate = !img.multi.animate; + if (img.multi.animate) { + dirty = img_frame_animate(&img, true); + set_timeout(animate, img.multi.frames[img.multi.sel].delay, true); + } else { + reset_timeout(animate); + } } return dirty; } |