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

nil safety in WidthCalculator::TypeZero #456

Closed yob closed 2 years ago

yob commented 2 years ago

A Type0 font with no descendants is invalid, but it's syntactically very possible for the DescendantFonts array of a Font object to have 0 items.

We need to confirm the descendant exists before we delegate to it.

Fixes #453