If the user enters an incorrect password when reading a protected pdf via document::load_from_raw_data() a message 'Incorrect password' is printed, however the function still returns a valid *document object. This returned object has doc->is_locked() == true and several methods are still available such as: doc->get_pdf_version() doc->info_date() doc->is_encrypted() doc->is_locked() This is useful. What's not good is that calling any of the other methods will cause a segfault. For example: doc->pages() doc->page_layout() doc->metadata() doc->create_pag() doc->fonts() Calling any of these methods on a locked document should raise a c++ exception (e.g. "error: pdf file is locked") rather than crashing.
we don't do exceptions, just don't call any document function if is_locked returns true. If you want to fix the crashing, patches welcome, but tbh it's not a huge priority to fix "using the API wrongly makes things crash"
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/poppler/poppler/issues/329.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.