diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2014-12-14 19:26:06 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2014-12-14 19:26:06 +0000 |
commit | 7a54aba3556c7378689ce14c9a1aa0f1ff3e0f1a (patch) | |
tree | 12119819893f0dcb289a3302aacbdd1c1626880b | |
parent | d241e0e64291a5445262241e95bce44fde6a39c7 (diff) | |
download | netsurf-chris/stop-gif-anim.tar.gz |
Exit immediately if the anim is flagged as being stoppedchris/stop-gif-anim
-rw-r--r-- | image/gif.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/image/gif.c b/image/gif.c index 7aa7bf359..423dcd619 100644 --- a/image/gif.c +++ b/image/gif.c @@ -143,6 +143,9 @@ static void nsgif_animate(void *p) int delay; int f; + /* Immediately return if we're not supposed to be running */ + if (gif->animating == false) return; + /* Advance by a frame, updating the loop count accordingly */ gif->current_frame++; if (gif->current_frame == (int)gif->gif->frame_count_partial) { @@ -160,7 +163,7 @@ static void nsgif_animate(void *p) } /* Continue animating if we should */ - if ((gif->gif->loop_count >= 0) && (gif->animating == true)) { + if (gif->gif->loop_count >= 0) { delay = gif->gif->frames[gif->current_frame].frame_delay; if (delay < nsoption_int(minimum_gif_delay)) delay = nsoption_int(minimum_gif_delay); |