summaryrefslogtreecommitdiff
path: root/image/gif.c
diff options
context:
space:
mode:
Diffstat (limited to 'image/gif.c')
-rw-r--r--image/gif.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/image/gif.c b/image/gif.c
index 871b1cc2c..3f5f6307e 100644
--- a/image/gif.c
+++ b/image/gif.c
@@ -305,7 +305,8 @@ static bool nsgif_convert(struct content *c)
/**
* Updates the GIF bitmap to display the current frame
*
- * \param c the content to update
+ * \param gif The gif context to update.
+ * \return GIF_OK on success else apropriate error code.
*/
static gif_result nsgif_get_frame(nsgif_content *gif)
{
@@ -317,10 +318,11 @@ static gif_result nsgif_get_frame(nsgif_content *gif)
current_frame = 0;
}
- if (current_frame < gif->gif->decoded_frame)
+ if (current_frame < gif->gif->decoded_frame) {
previous_frame = 0;
- else
+ } else {
previous_frame = gif->gif->decoded_frame + 1;
+ }
for (frame = previous_frame; frame <= current_frame; frame++) {
res = gif_decode_frame(gif->gif, frame);