Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/CHANGES.TXT
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
0.96.7 (unreleased)
-------------------
- Fix: Move C0 bounds check before match in CEA-708 Rust decoder to prevent process_p16 index-out-of-bounds panic on truncated ATSC1.0 TS blocks; improve C1 warn message with command code and lengths (#1407)
- New: Allow output \0 terminated frames via --null-terminated
- New: Added ASS/SSA \pos-based positioning for CEA-608 captions when layout is simple (1–2 rows) (#1726)
- Fix: Remove strdup() memory leaks in WebVTT styling encoder, fix invalid CSS rgba(0,256,0) green value, fix missing free(unescaped) on write-error path (#2154)
Expand Down
12 changes: 2 additions & 10 deletions src/rust/lib_ccxr/src/teletext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1004,16 +1004,8 @@ impl<'a> TeletextContext<'a> {
let mut line_count: u8 = 0;
let mut time_reported = false;
// Negative timestamps occur with wrap-around/uninitialized PTS in broadcast captures
let timecode_show = self
.page_buffer
.show_timestamp
.to_srt_time()
.ok()?;
let timecode_hide = self
.page_buffer
.hide_timestamp
.to_srt_time()
.ok()?;
let timecode_show = self.page_buffer.show_timestamp.to_srt_time().ok()?;
let timecode_hide = self.page_buffer.hide_timestamp.to_srt_time().ok()?;

// process data
for row in 1..25 {
Expand Down
25 changes: 16 additions & 9 deletions src/rust/src/decoder/service_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ impl dtvcc_service_decoder {
let code = block[0];
let C0Command { command, length } = C0Command::new(code);
debug!("C0: [{:?}] ({})", command, block.len());
if length as usize > block.len() {
warn!(
"dtvcc_handle_C0: command {:#04X} needs {} bytes but block only has {}; skipping",
code,
length,
block.len()
);
return -1;
}
match command {
// NUL command does nothing
C0CodeSet::NUL => {}
Expand All @@ -90,14 +99,6 @@ impl dtvcc_service_decoder {
C0CodeSet::P16 => self.process_p16(&block[1..]),
C0CodeSet::RESERVED => {}
}
if length as usize > block.len() {
warn!(
"dtvcc_handle_C0: command is {} bytes long but we only have {}",
length,
block.len()
);
return -1;
}
length as i32
}

Expand Down Expand Up @@ -286,7 +287,13 @@ impl dtvcc_service_decoder {
} = C1Command::new(code);

if length as usize > block.len() {
warn!("Warning: Not enough bytes for command.");
warn!(
"dtvcc_handle_C1: command {:#04X} ({}) needs {} bytes but block only has {}; skipping",
code,
name,
length,
block.len()
);
return -1;
}

Expand Down
Loading