PDF: prevent potential (error) stack overflow