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

Return initialization of EBook_CHM :: m_lookupTablesValid #21

Merged
merged 1 commit into from Jan 6, 2022
Merged

Return initialization of EBook_CHM :: m_lookupTablesValid #21

merged 1 commit into from Jan 6, 2022

Conversation

u-235
Copy link
Contributor

@u-235 u-235 commented Jan 6, 2022

The load function calls guessTextEncoding before attempting to update the m_chmTOPICS, m_chmSTRINGS, m_chmURLTBL and m_chmURLSTR objects. Thus, at the time guessTextEncoding is called, these objects and the m_lookupTablesValid flag contain an invalid value. However, guessTextEncoding can (via changeFileEncoding) implicitly call fillTopicsUrlMap, which uses these objects and a flag. In some cases, the combination of object parameters causes the application to crash due to lack of memory.

There were similar changes in fe6c414, but they got lost in the refactoring in 2bab405 and were permanently removed in f613164.

The load function calls guessTextEncoding before attempting to update
the m_chmTOPICS, m_chmSTRINGS, m_chmURLTBL, and m_chmURLSTR objects.
Thus, at the time guessTextEncoding is called, these objects and the
m_lookupTablesValid flag contain an invalid value. However,
guessTextEncoding can (via changeFileEncoding) implicitly call
fillTopicsUrlMap, which uses these objects and a flag. In some cases,
the combination of object parameters causes the application to crash
due to lack of memory.
@gyunaev gyunaev merged commit 869ecdf into gyunaev:master Jan 6, 2022
@gyunaev
Copy link
Owner

gyunaev commented Jan 6, 2022

Thank you for your report and the fix!

@u-235 u-235 deleted the ebook-chm-fix branch January 7, 2022 08:45
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.

None yet

2 participants