mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-10 09:02:14 +02:00
The LZW data for both GIF and TIFF images is sometimes intentionally missing an end-of-information (EOI) code, which technically is a decoding error, but in practive is handled gracefully by Firefox, Safari and Chrome for GIFs and Safari for TIFFs. Let's mirror their behavior. The included WPT test exposes the fact that trailing garbage bytes can also result in decoding errors. We handle this in the LZW logic rather than in the image decoding since our LZW implementation is currently only used by GIF and TIFF decoding. The error is logged behind the LZW_DEBUG flag.