Skip to content

Commit

Permalink
Decode AAC return error when AU data length is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
BenLocal committed Apr 10, 2024
1 parent 605b784 commit 1bf8795
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/format/rtpmpeg4audio/decoder_generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ func (d *Decoder) decodeGeneric(pkt *rtp.Packet) ([][]byte, error) {
// AUs
aus = make([][]byte, len(dataLens))
for i, dataLen := range dataLens {
if int(dataLen) == 0 {
return nil, fmt.Errorf("invalid AU-data-length")
}

if len(payload) < int(dataLen) {
return nil, fmt.Errorf("payload is too short")
}
Expand Down

0 comments on commit 1bf8795

Please sign in to comment.