From 8f78a8bbb2f9788b83c19e349d217d2527f89ebc Mon Sep 17 00:00:00 2001 From: Carlos Fernandez Date: Sat, 20 Dec 2025 22:34:44 +0100 Subject: [PATCH] fix(708): Handle null timing pointer in CEA-708 settings conversion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When converting CEA-708 decoder settings from C to Rust via from_ctype(), a null timing pointer would cause the entire conversion to fail and return None. This triggered the unwrap_or(default()) fallback, resetting critical settings like `enabled` and `services_enabled` to false/0. This caused CEA-708 captions to not be extracted (exit code 10) even when --service was specified, because the decoder's is_active flag was reset to 0 during demuxer initialization. The fix handles null timing pointer gracefully by using a default CommonTimingCtx instead of propagating None, preserving the other decoder settings. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/rust/src/ctorust.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/rust/src/ctorust.rs b/src/rust/src/ctorust.rs index 02bd94363..0101951b0 100755 --- a/src/rust/src/ctorust.rs +++ b/src/rust/src/ctorust.rs @@ -121,19 +121,25 @@ impl FromCType for DecoderDtvccSettings { { services_enabled[i] = flag != 0; } + // Handle timing - use default if pointer is null to avoid losing other settings + let timing = if settings.timing.is_null() { + CommonTimingCtx::default() + } else { + CommonTimingCtx::from_ctype(settings.timing).unwrap_or_default() + }; Some(DecoderDtvccSettings { enabled: settings.enabled != 0, print_file_reports: settings.print_file_reports != 0, no_rollup: settings.no_rollup != 0, report: if !settings.report.is_null() { - Some(DecoderDtvccReport::from_ctype(settings.report)?) + DecoderDtvccReport::from_ctype(settings.report) } else { None }, active_services_count: settings.active_services_count, services_enabled, - timing: CommonTimingCtx::from_ctype(settings.timing)?, + timing, }) } }