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

@@ -106,3 +106,26 @@ func TestDecode(t *testing.T) {
})
}
}
func FuzzDecoderUnmarshal(f *testing.F) {
d := &Decoder{
BitDepth: 24,
SampleRate: 48000,
ChannelCount: 2,
}
d.Init()
f.Fuzz(func(t *testing.T, b []byte) {
d.Decode(&rtp.Packet{
Header: rtp.Header{
Version: 2,
Marker: false,
PayloadType: 96,
SequenceNumber: 17645,
Timestamp: 2289527317,
SSRC: 0x9dbb7812,
},
Payload: b,
})
})
}