mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-04-19 04:22:49 +00:00
[PR #1812] [MERGED] fix(rust): prevent panics in timing code when processing multiple files #2552
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/1812
Author: @cfsmp3
Created: 12/14/2025
Status: ✅ Merged
Merged: 12/14/2025
Merged by: @cfsmp3
Base:
master← Head:fix/issue-1377-rust-panic📝 Commits (2)
0b262d0fix(rust): prevent panics in timing code when processing multiple files80e2117style: apply cargo fmt formatting📊 Changes
2 files changed (+72 additions, -34 deletions)
View changed files
📝
src/rust/lib_ccxr/src/time/units.rs(+6 -3)📝
src/rust/src/libccxr_exports/time.rs(+66 -31)📄 Description
Summary
thread caused non-unwinding panic. aborting.) when processing multiple files with different characteristics (e.g., DVD-type followed by HDTV-type media).unwrap()and.expect()calls with safe alternatives throughout the Rust timing codeGopTimeCode::new()to handle edge casesRoot Cause
The crash occurred because Rust code was using
.unwrap()on type conversions and.expect()on Result values inextern "C"functions. When processing files with different characteristics sequentially, stale timing state from previous files could cause these conversions to fail, triggering panics. Since Rust panics cannot unwind across FFI boundaries, this resulted in immediate process termination.Changes
src/rust/src/libccxr_exports/time.rs:unwrap_or(0)for alltry_into()conversionsapply_timing_info()andwrite_back_from_timing_info()ccxr_calculate_ms_gop_time()to use safe fallback calculationsrc/rust/lib_ccxr/src/time/units.rs:from_hms_millisfailures.expect()with.ok()?Test plan
Fixes #1377
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.