Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions slice_loss_indication.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (p SliceLossIndication) Marshal() ([]byte, error) {

// Unmarshal decodes the SliceLossIndication from binary.
func (p *SliceLossIndication) Unmarshal(rawPacket []byte) error {
if len(rawPacket) < (headerLength + ssrcLength) {
if len(rawPacket) < (headerLength + (ssrcLength * 2)) {
return errPacketTooShort
}

Expand All @@ -76,7 +76,7 @@ func (p *SliceLossIndication) Unmarshal(rawPacket []byte) error {
return errPacketTooShort
}

if header.Type != TypeTransportSpecificFeedback || header.Count != FormatSLI {
if header.Type != TypePayloadSpecificFeedback || header.Count != FormatSLI {
return errWrongType
}

Expand All @@ -103,7 +103,7 @@ func (p *SliceLossIndication) MarshalSize() int {
func (p *SliceLossIndication) Header() Header {
return Header{
Count: FormatSLI,
Type: TypeTransportSpecificFeedback,
Type: TypePayloadSpecificFeedback,
Length: uint16((p.MarshalSize() / 4) - 1), //nolint:gosec // G115
}
}
Expand Down
6 changes: 3 additions & 3 deletions slice_loss_indication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestSliceLossIndicationUnmarshal(t *testing.T) {
Name: "valid",
Data: []byte{
// SliceLossIndication
0x82, 0xcd, 0x0, 0x3,
0x82, 0xce, 0x0, 0x3,
// sender=0x902f9e2e
0x90, 0x2f, 0x9e, 0x2e,
// media=0x902f9e2e
Expand All @@ -39,7 +39,7 @@ func TestSliceLossIndicationUnmarshal(t *testing.T) {
{
Name: "short report",
Data: []byte{
0x81, 0xcd, 0x0, 0x2,
0x81, 0xce, 0x0, 0x2,
// ssrc=0x902f9e2e
0x90, 0x2f, 0x9e, 0x2e,
// report ends early
Expand Down Expand Up @@ -115,7 +115,7 @@ func TestSliceLossIndicationRoundTrip(t *testing.T) {
func TestSliceLossIndicationUnmarshalMaxLength(t *testing.T) {
rawPacket := make([]byte, 4*(0xFFFF+1))
rawPacket[0] = 0x82
rawPacket[1] = 0xcd
rawPacket[1] = 0xce
rawPacket[2] = 0xff
rawPacket[3] = 0xff

Expand Down
2 changes: 2 additions & 0 deletions testdata/fuzz/FuzzUnmarshal/0e87471a44c119a6
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
go test fuzz v1
[]byte("\x82\xce\x00\x010000")
Loading