Krolyxon
Commit 95a7496

Branches

Refs →

nsxiv95a7496

Fixed segfault in ci_toggle_animation, fixes issue #173

Author
Bert Münnich
Date
2014-09-01 20:40 +0200
Parent
f478385
Commit
95a7496edca2f4cffcb1e01dfa351cb0a42f07c2

+9 −8

2 files changed

  1. M Makefile +1 −1
  2. M commands.c +8 −7
M Makefile View
@@ -1,4 +1,4 @@
1−VERSION = git-20140829
1+VERSION = git-20140901
22
33 PREFIX = /usr/local
44 MANPREFIX = $(PREFIX)/share/man
M commands.c View
@@ -290,13 +290,14 @@ bool ci_toggle_animation(arg_t a)
290290 {
291291 bool dirty = false;
292292
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+ }
300301 }
301302 return dirty;
302303 }