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-04 22:29:34 +0100 |
commit | b3ebed6297bb797c1af45b33b448514bf05c46e5 (patch) | |
tree | c787fe645977b442ed4166e6d14ec434bb02d860 | |
parent | 18afa8d0048c86216643ab2e883503ab4c413f38 (diff) | |
download | libnsgif-b3ebed6297bb797c1af45b33b448514bf05c46e5.tar.gz libnsgif-b3ebed6297bb797c1af45b33b448514bf05c46e5.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 60209de..cdd5b6b 100644 --- a/src/libnsgif.c +++ b/src/libnsgif.c @@ -687,8 +687,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) { @@ -698,6 +696,8 @@ gif__decode(gif_animation *gif, } break; } + res = lzw_decode(gif->lzw_ctx, + &uncompressed, &available); } row_available = x < available ? x : available; |