diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2021-11-02 15:16:56 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2021-11-02 15:16:56 +0000 |
commit | 1f87439ecacaecbf70fdd740708745b1b90cad89 (patch) | |
tree | a4d977b106cc85a29c4ca17fa9c5b3558cbdb079 | |
parent | 827903b2cc1222b476c7f47bb462f526cb14a52c (diff) | |
download | libnsgif-1f87439ecacaecbf70fdd740708745b1b90cad89.tar.gz libnsgif-1f87439ecacaecbf70fdd740708745b1b90cad89.tar.bz2 |
GIF: Clean up preparation for first frame.
-rw-r--r-- | src/libnsgif.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/libnsgif.c b/src/libnsgif.c index fa9d8d0..e3cb1b5 100644 --- a/src/libnsgif.c +++ b/src/libnsgif.c @@ -1043,15 +1043,11 @@ gif_internal_decode_frame(gif_animation *gif, * the background colour or this is the first frame, clear * the frame data */ - if ((frame == 0) || (gif->decoded_frame == GIF_INVALID_FRAME)) { + if (frame == 0 || gif->decoded_frame == GIF_INVALID_FRAME) { memset((char*)frame_data, GIF_TRANSPARENT_COLOUR, - gif->width * gif->height * sizeof(int)); - gif->decoded_frame = frame; - /* The line below would fill the image with its - * background color, but because GIFs support - * transparency we likely wouldn't want to do that. */ - /* memset((char*)frame_data, colour_table[gif->background_index], gif->width * gif->height * sizeof(int)); */ + gif->width * gif->height * sizeof(*frame_data)); + } else if ((frame != 0) && (gif->frames[frame - 1].disposal_method == GIF_FRAME_CLEAR)) { ret = gif_clear_frame(gif, &gif->frames[frame - 1], frame_data); |