diff --git a/pkg/rtpaac/rtpaac_test.go b/pkg/rtpaac/rtpaac_test.go index a38d34ba..7b45d88d 100644 --- a/pkg/rtpaac/rtpaac_test.go +++ b/pkg/rtpaac/rtpaac_test.go @@ -267,6 +267,15 @@ func TestDecodeErrors(t *testing.T) { pkts [][]byte err string }{ + { + "invalid rtp", + [][]byte{ + { + 0xaa, + }, + }, + "RTP header size insufficient: 1 < 4", + }, { "missing payload", [][]byte{ diff --git a/pkg/rtph264/rtph264_test.go b/pkg/rtph264/rtph264_test.go index 4cf2bbd3..cb0b5683 100644 --- a/pkg/rtph264/rtph264_test.go +++ b/pkg/rtph264/rtph264_test.go @@ -287,6 +287,15 @@ func TestDecodeErrors(t *testing.T) { pkts [][]byte err string }{ + { + "invalid rtp", + [][]byte{ + { + 0xaa, + }, + }, + "RTP header size insufficient: 1 < 4", + }, { "missing payload", [][]byte{{ @@ -409,7 +418,7 @@ func TestReadSPSPPS(t *testing.T) { pps []byte }{ { - "standard", + "sps then pps", [][]byte{ {128, 96, 61, 205, 54, 67, 90, 125, 40, 249, 97, 176, 7, 1, 2}, {128, 96, 61, 206, 54, 67, 90, 125, 40, 249, 97, 176, 8, 3, 4}, @@ -417,6 +426,15 @@ func TestReadSPSPPS(t *testing.T) { []byte{0x07, 0x01, 0x02}, []byte{0x08, 0x03, 0x04}, }, + { + "pps then sps", + [][]byte{ + {128, 96, 61, 206, 54, 67, 90, 125, 40, 249, 97, 176, 8, 3, 4}, + {128, 96, 61, 205, 54, 67, 90, 125, 40, 249, 97, 176, 7, 1, 2}, + }, + []byte{0x07, 0x01, 0x02}, + []byte{0x08, 0x03, 0x04}, + }, } { t.Run(ca.name, func(t *testing.T) { i := 0