Prevent infinite loops in malformed PDFs