Skip to content

Commit 6ee61f4

Browse files
committed
Fix potential out-of-bounds in rust transmuxer
1 parent 8715fb1 commit 6ee61f4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/rs-core/transmux/nal_unit_producer.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,9 @@ impl NalUnitProducer {
380380
let mut emu_idx = 0;
381381
(0..new_len)
382382
.map(|_| {
383-
if source_idx == emulation_prevention_bytes_positions[emu_idx] {
383+
if emu_idx < emulation_prevention_bytes_positions.len()
384+
&& source_idx == emulation_prevention_bytes_positions[emu_idx]
385+
{
384386
// Skip this byte
385387
source_idx += 1;
386388
emu_idx += 1;

0 commit comments

Comments
 (0)