formatdecenc: fix crash in MJPEG decoder; add fuzz tests

This commit is contained in:
aler9
2023-01-07 16:43:45 +01:00
parent 441a90a519
commit 0499d99e83
46 changed files with 232 additions and 582 deletions

View File

@@ -131,3 +131,22 @@ func TestDecode(t *testing.T) {
})
}
}
func FuzzDecoderUnmarshal(f *testing.F) {
d := &Decoder{}
d.Init()
f.Fuzz(func(t *testing.T, b []byte, m bool) {
d.Decode(&rtp.Packet{
Header: rtp.Header{
Version: 2,
Marker: m,
PayloadType: 96,
SequenceNumber: 17645,
Timestamp: 2289527317,
SSRC: 0x9dbb7812,
},
Payload: b,
})
})
}