nsxiv95a7496
Fixed segfault in ci_toggle_animation, fixes issue #173
+9 −8
2 files changed
- M Makefile +1 −1
- M commands.c +8 −7
| @@ -1,4 +1,4 @@ | |||
| 1 | − | VERSION = git-20140829 | |
| 1 | + | VERSION = git-20140901 | |
| 2 | 2 | ||
| 3 | 3 | PREFIX = /usr/local | |
| 4 | 4 | MANPREFIX = $(PREFIX)/share/man | |
| @@ -290,13 +290,14 @@ bool ci_toggle_animation(arg_t a) | |||
| 290 | 290 | { | |
| 291 | 291 | bool dirty = false; | |
| 292 | 292 | ||
| 293 | − | img.multi.animate = !img.multi.animate; | |
| 294 | − | ||
| 295 | − | if (img.multi.animate) { | |
| 296 | − | dirty = img_frame_animate(&img, true); | |
| 297 | − | set_timeout(animate, img.multi.frames[img.multi.sel].delay, true); | |
| 298 | − | } else { | |
| 299 | − | reset_timeout(animate); | |
| 293 | + | if (img.multi.cnt > 0) { | |
| 294 | + | img.multi.animate = !img.multi.animate; | |
| 295 | + | if (img.multi.animate) { | |
| 296 | + | dirty = img_frame_animate(&img, true); | |
| 297 | + | set_timeout(animate, img.multi.frames[img.multi.sel].delay, true); | |
| 298 | + | } else { | |
| 299 | + | reset_timeout(animate); | |
| 300 | + | } | |
| 300 | 301 | } | |
| 301 | 302 | return dirty; | |
| 302 | 303 | } | |