On Sat Jun 20 21:37:18 2026 +0000, Esme Povirk wrote:
How did you create the test image? The test image is deterministically hand-built (64x64, 256-color). I generated the raw LZW code stream directly: a clear code, then ~3840 single-pixel codes that fill the 4096-entry code table, then the highest code (4095) three times, then padding codes up to 64x64, followed by the end-of-information code.
Filling the table freezes `RunningCode` at `LZ_MAX_CODE + 2`, so `RunningCode - 2` stays at 4095. With the bug, decoding code 4095 repeatedly rewrites entry 4095 (`Prefix[4095] = LastCode`); after the third one the entry references itself, so the prefix walk runs until `j == LZ_MAX_CODE` and `DGifDecompressLine` returns `GIF_ERROR`. A correct decoder keeps the full table intact and decodes all 4096 pixels. Happy to add a comment describing this to the test, or to build the image in C within the test instead of embedding the blob - whichever you prefer. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11209#note_143766