mirror of
https://github.com/aler9/gortsplib
synced 2025-10-11 10:00:25 +08:00
formatdecenc: fix crash in MJPEG decoder; add fuzz tests
This commit is contained in:
@@ -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,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user