Skip to content

Commit

Permalink
Merge pull request #343 from ixugo/dev
Browse files Browse the repository at this point in the history
[opt] 数据有效性长度检查,防止音频流无数据时 panic
  • Loading branch information
q191201771 authored Feb 26, 2024
2 parents 0beec39 + 41eff79 commit 90c1075
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/remux/avpacket2rtmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@ func (r *AvPacket2RtmpRemuxer) FeedAvPacket(pkt base.AvPacket) {
}

length := len(pkt.Payload) - 5 // -7+2
if length < 7 {
return
}
payload := make([]byte, length)
payload[0] = 0xAF
payload[1] = base.RtmpAacPacketTypeRaw
Expand Down

0 comments on commit 90c1075

Please sign in to comment.