Skip to content

Commit

Permalink
[crash] Handle subtitle packets with no data
Browse files Browse the repository at this point in the history
  • Loading branch information
emk committed Mar 5, 2017
1 parent 5d3364b commit 46df766
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vobsub/src/sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,9 @@ fn subtitle(raw_data: &[u8], base_time: f64) -> Result<Subtitle> {
// explicit offsets into `packet` in several places.

// Figure out where our control data starts.
if raw_data.len() < 2 {
return Err("unexpected end of subtitle data".into());
}
let (_, initial_control_offset) = parse_be_u16_as_usize(&raw_data[2..])?;

// Declare data we want to collect from our control packets.
Expand Down

0 comments on commit 46df766

Please sign in to comment.