mirror of
https://github.com/AlexxIT/go2rtc.git
synced 2026-04-22 23:57:20 +08:00
Fix panic on h264.EmitNalus #1076
This commit is contained in:
@@ -67,11 +67,15 @@ func EmitNalus(nals []byte, isAVC bool, emit func([]byte)) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for {
|
for {
|
||||||
end := 4 + binary.BigEndian.Uint32(nals)
|
n := uint32(len(nals))
|
||||||
emit(nals[4:end])
|
if n < 4 {
|
||||||
if int(end) >= len(nals) {
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
end := 4 + binary.BigEndian.Uint32(nals)
|
||||||
|
if n < end {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
emit(nals[4:end])
|
||||||
nals = nals[end:]
|
nals = nals[end:]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user