summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarthSim <darthsim@gmail.com>2022-04-15 16:40:41 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2022-04-15 16:40:41 +0100
commitaa6e2af43ebb898167f6dc0bb8215eacf0a17389 (patch)
tree3b745812a75c29b297e3a3cca79ec4d245de69e4
parent59566cafec6ba3f0eca7718859f2a742469d5b47 (diff)
downloadlibnsgif-aa6e2af43ebb898167f6dc0bb8215eacf0a17389.tar.gz
libnsgif-aa6e2af43ebb898167f6dc0bb8215eacf0a17389.tar.bz2
GIF: Try to recover after LZW_EOI_CODE.
-rw-r--r--src/gif.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gif.c b/src/gif.c
index 509883e..aeb70f2 100644
--- a/src/gif.c
+++ b/src/gif.c
@@ -471,7 +471,8 @@ static nsgif_error nsgif__decode_complex(
while (available == 0) {
if (res != LZW_OK) {
/* Unexpected end of frame, try to recover */
- if (res == LZW_OK_EOD) {
+ if (res == LZW_OK_EOD ||
+ res == LZW_EOI_CODE) {
ret = NSGIF_OK;
} else {
ret = nsgif__error_from_lzw(res);
@@ -557,7 +558,7 @@ static nsgif_error nsgif__decode_simple(
frame_data += written;
if (res != LZW_OK) {
/* Unexpected end of frame, try to recover */
- if (res == LZW_OK_EOD) {
+ if (res == LZW_OK_EOD || res == LZW_EOI_CODE) {
ret = NSGIF_OK;
} else {
ret = nsgif__error_from_lzw(res);