Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PDFium abuse that leads to a crash on Windows ARM #3460

Merged
merged 2 commits into from
Feb 4, 2025

Conversation

cebtenzzre
Copy link
Member

With -DGPT4ALL_USE_QTPDF=OFF, we hit an embarrassingly misplaced call to FPDF_DestroyLibrary() after the first PDF is read. This prevents further use of PDFium without a call to FPDF_InitLibrary, which never happens.

So after we read a few PDFs, this causes a crash. The fix is to destroy it at shutdown instead. There is also a change here to improve the exception safety of m_page, which might result in a double-free otherwise.

@cebtenzzre cebtenzzre marked this pull request as ready for review February 4, 2025 20:09
@cebtenzzre cebtenzzre requested a review from manyoso February 4, 2025 20:09
@cebtenzzre cebtenzzre merged commit 014bf67 into main Feb 4, 2025
4 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants