There was an error while loading. Please reload this page.
1 parent 0feba07 commit 25428b4Copy full SHA for 25428b4
1 file changed
crates/enc-avfoundation/src/mp4.rs
@@ -327,9 +327,10 @@ impl MP4Encoder {
327
let mut offset = 0;
328
for plane_i in 0..frame.planes() {
329
let data = frame.data(plane_i);
330
- block_buf_slice[offset..offset + data.len()]
331
- .copy_from_slice(&data[0..frame.samples() * frame.format().bytes()]);
332
- offset += data.len();
+ let channel_data_len = frame.samples() * frame.format().bytes();
+ block_buf_slice[offset..offset + channel_data_len]
+ .copy_from_slice(&data[0..channel_data_len]);
333
+ offset += channel_data_len;
334
}
335
} else {
336
block_buf_slice.copy_from_slice(&frame.data(0)[0..total_data]);
0 commit comments