From b9b12bfd5c6f8394cc9a4a548bd6dc0f5fb2f70b Mon Sep 17 00:00:00 2001 From: Robert Ancell Date: Tue, 4 Dec 2018 16:51:36 +1300 Subject: gif: Fix multiple LZW clear codes breaking decoding The following was occurring: 1. A clear code is detected in the LZW stream 2. The first code is detected as a clear. 3. The following code is returned as a color index, this breaks if it is a clear. There were two codepaths in use, one for handling the first clear in the LZW sequence and another for handling clears within the sequence. The former handled sequential clears correctly, the latter did not. The solution is to the correct codepath and remove the other one. This simplification should not affect other decoding (as confirmed by the test suite). --- tests/test-images/gif-test-suite/TESTS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/test-images/gif-test-suite/TESTS b/tests/test-images/gif-test-suite/TESTS index cc986661e..1d4a3f13f 100644 --- a/tests/test-images/gif-test-suite/TESTS +++ b/tests/test-images/gif-test-suite/TESTS @@ -33,8 +33,8 @@ extra-data no-clear no-eoi no-clear-and-eoi -#many-clears -#double-clears +many-clears +double-clears invalid-colors max-width max-height -- cgit v1.2.1