diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2021-11-02 13:41:44 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2021-11-02 13:41:44 +0000 |
commit | 8b30f0709564df422c549cccc1a7868588c30a67 (patch) | |
tree | 5a58b54f3b19f50d44499c73a2ab00a1bcc21472 | |
parent | eb0aa2326fd1da0bf4c74d083f889eec1632e1dd (diff) | |
download | libnsgif-8b30f0709564df422c549cccc1a7868588c30a67.tar.gz libnsgif-8b30f0709564df422c549cccc1a7868588c30a67.tar.bz2 |
GIF: Clear: Remove redundant disposal method check.
-rw-r--r-- | src/libnsgif.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/libnsgif.c b/src/libnsgif.c index f68c15d..a12e128 100644 --- a/src/libnsgif.c +++ b/src/libnsgif.c @@ -850,6 +850,8 @@ gif_clear_frame(gif_animation *gif, uint32_t frame) uint32_t save_buffer_position; uint32_t return_value = 0; + assert(gif->frames[frame].disposal_method == GIF_FRAME_CLEAR); + /* Ensure this frame is supposed to be decoded */ if (gif->frames[frame].display == false) { return GIF_OK; @@ -914,22 +916,20 @@ gif_clear_frame(gif_animation *gif, uint32_t frame) } /* Clear our frame */ - if (gif->frames[frame].disposal_method == GIF_FRAME_CLEAR) { - uint32_t y; - for (y = 0; y < height; y++) { - uint32_t *frame_scanline; - frame_scanline = frame_data + offset_x + ((offset_y + y) * gif->width); - if (gif->frames[frame].transparency) { - memset(frame_scanline, - GIF_TRANSPARENT_COLOUR, - width * 4); - } else { - memset(frame_scanline, - colour_table[gif->background_index], - width * 4); - } + for (uint32_t y = 0; y < height; y++) { + uint32_t *frame_scanline; + frame_scanline = frame_data + offset_x + ((offset_y + y) * gif->width); + if (gif->frames[frame].transparency) { + memset(frame_scanline, + GIF_TRANSPARENT_COLOUR, + width * 4); + } else { + memset(frame_scanline, + colour_table[gif->background_index], + width * 4); } } + gif_decode_frame_exit: /* Restore the buffer position */ gif->buffer_position = save_buffer_position; |