1
0
Fork 0
mirror of https://github.com/alfg/mp4-rust.git synced 2025-01-03 00:48:40 +00:00

bugfix: sample offset larger than u32 max

This commit is contained in:
Andrew Straw 2024-06-15 07:10:38 +02:00
parent 35560e94f5
commit f5744a39e2

View file

@ -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)
}
}