Fix panic for broken RTP with AAC #697
This commit is contained in:
+5
-1
@@ -28,9 +28,13 @@ func RTPDepay(handler core.HandlerFunc) core.HandlerFunc {
|
|||||||
headers := packet.Payload[2 : 2+headersSize]
|
headers := packet.Payload[2 : 2+headersSize]
|
||||||
units := packet.Payload[2+headersSize:]
|
units := packet.Payload[2+headersSize:]
|
||||||
|
|
||||||
for len(headers) > 0 {
|
for len(headers) >= 2 {
|
||||||
unitSize := binary.BigEndian.Uint16(headers) >> 3
|
unitSize := binary.BigEndian.Uint16(headers) >> 3
|
||||||
|
|
||||||
|
if len(units) < int(unitSize) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
unit := units[:unitSize]
|
unit := units[:unitSize]
|
||||||
|
|
||||||
headers = headers[2:]
|
headers = headers[2:]
|
||||||
|
|||||||
Reference in New Issue
Block a user