yob / pdf-reader

The PDF::Reader library implements a PDF parser conforming as much as possible to the PDF specification from Adobe.
MIT License
1.81k stars 271 forks source link

add some nil safety to LZW decompression #454

Closed yob closed 2 years ago

yob commented 2 years ago

Based on the data provided in #449.

For now I think I'd prefer to err on the side of strictness and raise one of our documented errors when a PDF file contains invalid LZW compressed data.

I'm mulling over how to handle this sort of issue long term though. It's definitely true that other PDF readers tend to treat this kind of thing as a soft error and do their best to render the rest of the page anyway.