rtph264: add error in case of a fragmented NALU with two starting packets

This commit is contained in:
aler9
2021-07-24 17:14:39 +02:00
parent b60c4a65b2
commit 4ac9cda1fe
2 changed files with 61 additions and 38 deletions

View File

@@ -416,6 +416,28 @@ func TestDecodeErrors(t *testing.T) {
},
"expected FU-A packet, got another type",
},
{
"FU-A with two starting packets",
[][]byte{
mergeBytes(
[]byte{
0x80, 0x60, 0x44, 0xed, 0x88, 0x77, 0x79, 0xab,
0x9d, 0xbb, 0x78, 0x12, 0x1c, 0x85,
},
bytes.Repeat([]byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}, 182),
[]byte{0x00, 0x01},
),
mergeBytes(
[]byte{
0x80, 0x60, 0x44, 0xed, 0x88, 0x77, 0x79, 0xab,
0x9d, 0xbb, 0x78, 0x12, 0x1c, 0x85,
},
bytes.Repeat([]byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}, 182),
[]byte{0x00, 0x01},
),
},
"invalid FU-A packet (decoded two starting packets in a row)",
},
{
"MTAP",
[][]byte{{