Skip to content

Commit ab08bff

Browse files
rust: handle I/O errors in process_word_file (fixes #1990)
1 parent bce0c92 commit ab08bff

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

docs/CHANGES.TXT

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
0.96.5 (2026-01-05)
22
-------------------
3+
- Fix: Rust word file parser panic when reading malformed lines (#1990)
34
- New: Add support for raw CDP (Caption Distribution Packet) files (#1406)
45
- New: Add --scc-accurate-timing option for bandwidth-aware SCC output (#1120)
56
- Fix: MXF files containing CEA-708 captions not being detected/extracted (#1647)

src/rust/src/parser.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,16 @@ fn process_word_file(filename: &str, list: &mut Vec<String>) -> Result<(), std::
107107

108108
for line in reader.lines() {
109109
num += 1;
110-
let line = line.unwrap();
110+
let line = match line {
111+
Ok(l) => l,
112+
Err(e) => {
113+
eprintln!(
114+
"Error reading line {} in word file {}: {}",
115+
num, filename, e
116+
);
117+
continue;
118+
}
119+
};
111120
if line.starts_with('#') {
112121
continue;
113122
}

0 commit comments

Comments
 (0)