mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-03 21:23:48 +00:00
[PR #2005] fix: Prevent NULL pointer dereference in DVB subtitle decoder #2809
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?
Original Pull Request: https://github.com/CCExtractor/ccextractor/pull/2005
State: closed
Merged: Yes
Summary
regionbefore accessingregion->bgcolorin the OCR processing block ofwrite_dvb_sub()Problem
When processing DVB subtitles, the
write_dvb_sub()function iterates through display items callingget_region(). After the loop, if all regions returned NULL, theregionvariable remains NULL. The code then attempts to accessregion->bgcolorin the OCR block, causing a segmentation fault.Crash details:
bgcolorfield inDVBSubRegionstructRoot Cause
Fix
Add
&& regionto the condition before the OCR block.Test Plan
🤖 Generated with Claude Code