mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-03 21:23:48 +00:00
[PR #1855] [MERGED] fix(raw): Fix premature EOF and timing overflow in raw_loop #2620
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/1855
Author: @cfsmp3
Created: 12/20/2025
Status: ✅ Merged
Merged: 12/20/2025
Merged by: @cfsmp3
Base:
master← Head:fix/issue-1565-raw-loop-eof📝 Commits (1)
ebfa31cfix(raw): Fix premature EOF and timing overflow in raw_loop (#1565)📊 Changes
1 file changed (+21 additions, -5 deletions)
View changed files
📝
src/lib_ccx/general_loop.c(+21 -5)📄 Description
Summary
Fixes #1565 - CCExtractor stops processing raw caption files at exactly 9:43:00 (2MB).
Root causes found and fixed:
Premature EOF bug: After processing the first chunk (BUFSIZE = ~2MB),
data->lenwas never reset to 0. On the next iteration,general_get_more_data()calculatedwant = BUFSIZE - data->len = 0and returned EOF immediately.data->len = 0after processing each chunk and changed loop condition fromwhile (data->len)towhile (1)with explicit breaks.32-bit integer overflow: The calculation
cb_field1 * 1001 / 30 * (MPEG_CLOCK_FREQ / 1000)overflowed whencb_field1was large (>1 million). For example,34,989,487 * 90 = 3,149,053,830exceeds the 32-bit signed integer max (2,147,483,647).cb_field1toLLONGbefore the multiplication.Timing initialization: Raw mode needs proper initialization (
min_pts=0,sync_pts=0,pts_set=MinPtsSet) for the Rust timing code to calculatefts_nowcorrectly.Test plan
Tested with sample files from issue #1565:
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.