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