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

Don't pass nil to Font.new when parsing XObjects #460

Closed yob closed 2 years ago

yob commented 2 years ago

@objects.deref_hash() can return nil, but Font.new doesn't handle a nil second arg very well.

As a general rule @objects.deref_hash() will not return nil. If it does, it's probably a corrupt file, so this is an edge case.

This matches the way we initialize Font objects in PageState as well.