diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2021-04-04 22:29:34 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2021-04-18 17:28:12 +0100 |
commit | db49e5b61beb1759469f3e6bd53850c6bc0a38ac (patch) | |
tree | bd1afc8fd2cf9d72eba436d2091023a13fa760fe | |
parent | 9dd7f040b1dffbe94b833aeede412054544709e8 (diff) | |
download | libnsgif-db49e5b61beb1759469f3e6bd53850c6bc0a38ac.tar.gz libnsgif-db49e5b61beb1759469f3e6bd53850c6bc0a38ac.tar.bz2 |
gif: Handle any uncompressed output before exiting due to error.
-rw-r--r-- | src/libnsgif.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libnsgif.c b/src/libnsgif.c index e0d97c0..752f8c2 100644 --- a/src/libnsgif.c +++ b/src/libnsgif.c @@ -672,8 +672,6 @@ gif__decode(gif_animation *gif, const uint8_t *uncompressed; unsigned row_available; if (available == 0) { - res = lzw_decode(gif->lzw_ctx, - &uncompressed, &available); if (res != LZW_OK) { /* Unexpected end of frame, try to recover */ if (res == LZW_OK_EOD) { @@ -683,6 +681,8 @@ gif__decode(gif_animation *gif, } break; } + res = lzw_decode(gif->lzw_ctx, + &uncompressed, &available); } row_available = x < available ? x : available; |