Skip to content

Commit

Permalink
Fix memory allocation for HomeKit OPUS
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Dec 28, 2023
1 parent 853e988 commit c8c3b22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/opus/homekit.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func repackToHAP60(handler core.HandlerFunc) core.HandlerFunc {

toc := pkt.Payload[0]

payload := make([]byte, 2, len(framesSize)+len(framesData))
payload := make([]byte, 2, 2+len(framesSize)+len(framesData))
payload[0] = toc | 0b11 // code 3 (multiple frames per packet)
payload[1] = 0b1000_0011 // VBR, no padding, 3 frames
payload = append(payload, framesSize...)
Expand Down

0 comments on commit c8c3b22

Please sign in to comment.