Skip to content

Segfault if the document object is not explicitly stored before using search #83

Description

@0xbe7a

This segfaults:

from poppler import load_from_data, SearchDirection, CaseSensitivity, load_from_file

# https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf
page = load_from_file("dummy.pdf").create_page(0)

page_rect = page.page_rect()

dummy_rect = page.search("Dummy", page_rect, SearchDirection.from_top, CaseSensitivity.case_sensitive)

while this works

from poppler import load_from_data, SearchDirection, CaseSensitivity, load_from_file

# https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf
doc = load_from_file("dummy.pdf")
page = doc.create_page(0)

page_rect = page.page_rect()

dummy_rect = page.search("Dummy", page_rect, SearchDirection.from_top, CaseSensitivity.case_sensitive)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions