Skip to content

Commit

Permalink
adts: when there are no frames to be parsed, dont try to calculate n_…
Browse files Browse the repository at this point in the history
…frames
  • Loading branch information
dedobbin committed Aug 31, 2023
1 parent b0e7d2d commit 8c0f81c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion symphonia-codec-aac/src/adts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,12 @@ fn aproximate_frame_count(mut source: &mut MediaSourceStream) -> Option<u64> {

let header = match AdtsHeader::read(&mut source) {
Ok(header) => header,
_ => break Some(calculate_n_frames!(n_bytes, parsed_n_frames, total_len)),
_ => {
if parsed_n_frames == 0 {
break None;
}
break Some(calculate_n_frames!(n_bytes, parsed_n_frames, total_len));
}
};

if source.ignore_bytes(header.frame_len as u64).is_err() {
Expand Down

0 comments on commit 8c0f81c

Please sign in to comment.