Skip to content

Commit 0fdfb75

Browse files
authored
fix(708): Handle null timing pointer in CEA-708 settings conversion
2 parents 0b5f13e + 8f78a8b commit 0fdfb75

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/rust/src/ctorust.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,25 @@ impl FromCType<ccx_decoder_dtvcc_settings> for DecoderDtvccSettings {
121121
{
122122
services_enabled[i] = flag != 0;
123123
}
124+
// Handle timing - use default if pointer is null to avoid losing other settings
125+
let timing = if settings.timing.is_null() {
126+
CommonTimingCtx::default()
127+
} else {
128+
CommonTimingCtx::from_ctype(settings.timing).unwrap_or_default()
129+
};
124130

125131
Some(DecoderDtvccSettings {
126132
enabled: settings.enabled != 0,
127133
print_file_reports: settings.print_file_reports != 0,
128134
no_rollup: settings.no_rollup != 0,
129135
report: if !settings.report.is_null() {
130-
Some(DecoderDtvccReport::from_ctype(settings.report)?)
136+
DecoderDtvccReport::from_ctype(settings.report)
131137
} else {
132138
None
133139
},
134140
active_services_count: settings.active_services_count,
135141
services_enabled,
136-
timing: CommonTimingCtx::from_ctype(settings.timing)?,
142+
timing,
137143
})
138144
}
139145
}

0 commit comments

Comments
 (0)