mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-03 21:23:48 +00:00
[PR #1586] [MERGED] ocr_bitmap can run out of buffer memory copying the "last font tag" #2297
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/CCExtractor/ccextractor/pull/1586
Author: @jstrot
Created: 1/7/2024
Status: ✅ Merged
Merged: 3/11/2025
Merged by: @prateekmedia
Base:
master← Head:qualip-ocr_bitmap-last_font_tag📝 Commits (10+)
c51f367ASAN: process_spu copies overlapping bufferse9cc967ocr_bitmap: Make sure there is enough room for the last_font_tagfc8dfa6Update CHANGES.TXT69a115eMerge branch 'master' of https://github.com/CCExtractor/ccextractor into qualip-ocr_bitmap-last_font_tag81550c3Merge branch 'master' of https://github.com/CCExtractor/ccextractor into qualip-ocr_bitmap-last_font_tagde88c63Baseline formatting fixeseb058eafixup! Baseline formatting fixes6f406edfixup! fixup! Baseline formatting fixes4a25a04Fix rust comment formatting6264d5bcxx_options.copy_from_rust: Avoid "mutable reference to mutable static" warning📊 Changes
3 files changed (+3 additions, -1 deletions)
View changed files
📝
docs/CHANGES.TXT(+1 -0)📝
src/lib_ccx/dvd_subtitle_decoder.c(+1 -1)📝
src/lib_ccx/ocr.c(+1 -0)📄 Description
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
memcpyon overlapping buffers. I can't say I understand why the buffers would be overlapping but usingmemmoveat least fixes the error.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.