summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Cupitt <jcupitt@gmail.com>2021-03-07 14:37:33 +0000
committerMichael Drake <michael.drake@codethink.co.uk>2021-03-08 12:11:09 +0000
commit3665353c4da1dfb7b4a1d9fa412f0dec2cb673d2 (patch)
tree898dbac9f3465c8fa1af142943128af67adb7e86
parente5802bc82dd3b85eec48437c44a299457f6b3b3c (diff)
downloadlibnsgif-3665353c4da1dfb7b4a1d9fa412f0dec2cb673d2.tar.gz
libnsgif-3665353c4da1dfb7b4a1d9fa412f0dec2cb673d2.tar.bz2
fix libnsgif restore/record ordering
-rw-r--r--src/libnsgif.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libnsgif.c b/src/libnsgif.c
index 479d161..49e790a 100644
--- a/src/libnsgif.c
+++ b/src/libnsgif.c
@@ -680,11 +680,6 @@ gif_internal_decode_frame(gif_animation *gif,
return GIF_OK;
}
- if (gif->frames[frame].disposal_method == GIF_FRAME_RESTORE) {
- /* Store the previous frame for later restoration */
- gif__record_previous_frame(gif);
- }
-
/* Get the start of our frame data and the end of the GIF data */
gif_data = gif->gif_data + gif->frames[frame].frame_pointer;
gif_end = gif->gif_data + gif->buffer_size;
@@ -873,6 +868,12 @@ gif_internal_decode_frame(gif_animation *gif,
gif->width * gif->height * sizeof(int));
}
}
+
+ if (gif->frames[frame].disposal_method == GIF_FRAME_RESTORE) {
+ /* Store the previous frame for later restoration */
+ gif__record_previous_frame(gif);
+ }
+
gif->decoded_frame = frame;
gif->buffer_position = (gif_data - gif->gif_data) + 1;