Segfault report with sample

I would like to check the outlines of incoming PDF documents. My first try involved a very simple document on which a naive approach breaks down. I would be happy to handle an Outline object with which some attributes return None, but instead I get an object where some attributes cause a segmentation fault.

My system is Debian 12, with Python 3.12.3 and PyMuPDF 1.26.3. Here I attach my segfaulting script and the 4-page PDF that activates it. (I see the same problem with other simple PDF’s. I send this one because it’s small.)

I can probably work around this somehow, but I thought the devs might be interested and maybe fix it.

Sincere thanks for sharing your time and expertise.

segfault.py (1.2 KB)
fourpages.pdf (12.9 KB)