-
Notifications
You must be signed in to change notification settings - Fork 425
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
ocr_bitmap can run out of buffer memory copying the "last font tag" #1586
base: master
Are you sure you want to change the base?
Conversation
CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit 79aaf86...:
All tests passing on the master branch were passed completely. NOTE: The following tests have been failing on the master branch as well as the PR:
Check the result page for more info. |
CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results, when compared to test for commit 280939d...:
All tests passing on the master branch were passed completely. NOTE: The following tests have been failing on the master branch as well as the PR:
Check the result page for more info. |
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
Version: 0.94
During OCR of a VOB PS, ccextractor can run out of buffer space if it has to copy all text since the last font tag (which can also be the beginning of the input):
I believe the bug existed since that piece of code was introduced way back in 2017 (#844)
The fix simply makes sure the allocated buffer is big enough for this extra string.
Example crash under gdb:
Before actually reaching this point I also had to fix an ASAN error with process_spu using
memcpy
on overlapping buffers. I can't say I understand why the buffers would be overlapping but usingmemmove
at least fixes the error.