From aa6e2af43ebb898167f6dc0bb8215eacf0a17389 Mon Sep 17 00:00:00 2001 From: DarthSim Date: Fri, 15 Apr 2022 16:40:41 +0100 Subject: GIF: Try to recover after LZW_EOI_CODE. --- src/gif.c | 5 +++-- 1 file 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); -- cgit v1.2.1