PDF: add protection against a type of premature scanning