Skip to content

bugfix: sample offset larger than u32 max #141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions src/track.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,12 +490,12 @@ impl Mp4Track {

let first_sample_in_chunk = sample_id - (sample_id - first_sample) % samples_per_chunk;

let mut sample_offset = 0;
let mut sample_offset: u64 = 0;
for i in first_sample_in_chunk..sample_id {
sample_offset += self.sample_size(i)?;
sample_offset += self.sample_size(i)? as u64;
}

Ok(chunk_offset + sample_offset as u64)
Ok(chunk_offset + sample_offset)
}
}

Expand Down
Loading