mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 23:26:54 +08:00
rewrite fuzz tests of decoders in order to get deterministic results (#261)
This commit is contained in:
@@ -184,10 +184,22 @@ func TestDecodeUntilMarker(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func FuzzDecoder(f *testing.F) {
|
func FuzzDecoder(f *testing.F) {
|
||||||
d := &Decoder{}
|
f.Fuzz(func(t *testing.T, a []byte, b []byte) {
|
||||||
d.Init()
|
d := &Decoder{}
|
||||||
|
d.Init()
|
||||||
|
|
||||||
|
d.Decode(&rtp.Packet{
|
||||||
|
Header: rtp.Header{
|
||||||
|
Version: 2,
|
||||||
|
Marker: false,
|
||||||
|
PayloadType: 96,
|
||||||
|
SequenceNumber: 17645,
|
||||||
|
Timestamp: 2289527317,
|
||||||
|
SSRC: 0x9dbb7812,
|
||||||
|
},
|
||||||
|
Payload: a,
|
||||||
|
})
|
||||||
|
|
||||||
f.Fuzz(func(t *testing.T, b []byte) {
|
|
||||||
d.Decode(&rtp.Packet{
|
d.Decode(&rtp.Packet{
|
||||||
Header: rtp.Header{
|
Header: rtp.Header{
|
||||||
Version: 2,
|
Version: 2,
|
||||||
|
@@ -1,2 +1,3 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
[]byte("800")
|
[]byte("800")
|
||||||
|
[]byte("0")
|
@@ -1,2 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
[]byte("\x1c\xd4")
|
|
@@ -1,2 +1,3 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
[]byte("8")
|
[]byte("8")
|
||||||
|
[]byte("")
|
@@ -1,3 +1,3 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
[]byte("0")
|
[]byte("0")
|
||||||
bool(false)
|
[]byte("")
|
@@ -1,2 +1,3 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
|
[]byte("0")
|
||||||
[]byte("80")
|
[]byte("80")
|
@@ -1,2 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
[]byte("\x1c")
|
|
@@ -1,3 +1,3 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
[]byte("0")
|
[]byte("0")
|
||||||
bool(false)
|
[]byte("<")
|
3
pkg/formats/rtph264/testdata/fuzz/FuzzDecoder/edbcdbb8d9f1bdac
vendored
Normal file
3
pkg/formats/rtph264/testdata/fuzz/FuzzDecoder/edbcdbb8d9f1bdac
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
[]byte("0")
|
||||||
|
[]byte("\\0")
|
@@ -1,2 +1,3 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
|
[]byte("0")
|
||||||
[]byte("9")
|
[]byte("9")
|
@@ -1,2 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
[]byte("\x1c0")
|
|
@@ -36,10 +36,22 @@ func TestDecode(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func FuzzDecoder(f *testing.F) {
|
func FuzzDecoder(f *testing.F) {
|
||||||
d := &Decoder{}
|
f.Fuzz(func(t *testing.T, a []byte, b []byte) {
|
||||||
d.Init()
|
d := &Decoder{}
|
||||||
|
d.Init()
|
||||||
|
|
||||||
|
d.Decode(&rtp.Packet{
|
||||||
|
Header: rtp.Header{
|
||||||
|
Version: 2,
|
||||||
|
Marker: false,
|
||||||
|
PayloadType: 96,
|
||||||
|
SequenceNumber: 17645,
|
||||||
|
Timestamp: 2289527317,
|
||||||
|
SSRC: 0x9dbb7812,
|
||||||
|
},
|
||||||
|
Payload: a,
|
||||||
|
})
|
||||||
|
|
||||||
f.Fuzz(func(t *testing.T, b []byte) {
|
|
||||||
d.Decode(&rtp.Packet{
|
d.Decode(&rtp.Packet{
|
||||||
Header: rtp.Header{
|
Header: rtp.Header{
|
||||||
Version: 2,
|
Version: 2,
|
||||||
|
@@ -1,3 +1,3 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
[]byte("00")
|
[]byte("00")
|
||||||
bool(false)
|
[]byte("b00")
|
@@ -1,2 +1,3 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
|
[]byte("0")
|
||||||
[]byte("b0")
|
[]byte("b0")
|
@@ -1,2 +1,3 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
|
[]byte("0")
|
||||||
[]byte("a00")
|
[]byte("a00")
|
3
pkg/formats/rtph265/testdata/fuzz/FuzzDecoder/717a02ebf21c41db
vendored
Normal file
3
pkg/formats/rtph265/testdata/fuzz/FuzzDecoder/717a02ebf21c41db
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
[]byte("0")
|
||||||
|
[]byte("\xe50")
|
@@ -1,2 +1,3 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
|
[]byte("0")
|
||||||
[]byte("")
|
[]byte("")
|
@@ -1,2 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
[]byte("d0")
|
|
@@ -1,2 +1,3 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
[]byte("a0")
|
[]byte("a0")
|
||||||
|
[]byte("")
|
3
pkg/formats/rtph265/testdata/fuzz/FuzzDecoder/a7fab38f1f1629f8
vendored
Normal file
3
pkg/formats/rtph265/testdata/fuzz/FuzzDecoder/a7fab38f1f1629f8
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
[]byte("b0\xd2")
|
||||||
|
[]byte("0")
|
@@ -1,2 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
[]byte("bbbbbbbbbbbbb0")
|
|
@@ -1,2 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
[]byte("b0\xcd")
|
|
@@ -1,2 +1,3 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
[]byte("a000")
|
[]byte("a000")
|
||||||
|
[]byte("0")
|
@@ -31,14 +31,14 @@ func TestDecode(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func FuzzDecoder(f *testing.F) {
|
func FuzzDecoder(f *testing.F) {
|
||||||
d := &Decoder{
|
|
||||||
BitDepth: 24,
|
|
||||||
SampleRate: 48000,
|
|
||||||
ChannelCount: 2,
|
|
||||||
}
|
|
||||||
d.Init()
|
|
||||||
|
|
||||||
f.Fuzz(func(t *testing.T, b []byte) {
|
f.Fuzz(func(t *testing.T, b []byte) {
|
||||||
|
d := &Decoder{
|
||||||
|
BitDepth: 24,
|
||||||
|
SampleRate: 48000,
|
||||||
|
ChannelCount: 2,
|
||||||
|
}
|
||||||
|
d.Init()
|
||||||
|
|
||||||
d.Decode(&rtp.Packet{
|
d.Decode(&rtp.Packet{
|
||||||
Header: rtp.Header{
|
Header: rtp.Header{
|
||||||
Version: 2,
|
Version: 2,
|
||||||
|
@@ -28,14 +28,26 @@ func TestDecode(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func FuzzDecoder(f *testing.F) {
|
func FuzzDecoder(f *testing.F) {
|
||||||
d := &Decoder{}
|
f.Fuzz(func(t *testing.T, a []byte, am bool, b []byte, bm bool) {
|
||||||
d.Init()
|
d := &Decoder{}
|
||||||
|
d.Init()
|
||||||
|
|
||||||
f.Fuzz(func(t *testing.T, b []byte, m bool) {
|
|
||||||
d.Decode(&rtp.Packet{
|
d.Decode(&rtp.Packet{
|
||||||
Header: rtp.Header{
|
Header: rtp.Header{
|
||||||
Version: 2,
|
Version: 2,
|
||||||
Marker: m,
|
Marker: am,
|
||||||
|
PayloadType: 96,
|
||||||
|
SequenceNumber: 17645,
|
||||||
|
Timestamp: 2289527317,
|
||||||
|
SSRC: 0x9dbb7812,
|
||||||
|
},
|
||||||
|
Payload: a,
|
||||||
|
})
|
||||||
|
|
||||||
|
d.Decode(&rtp.Packet{
|
||||||
|
Header: rtp.Header{
|
||||||
|
Version: 2,
|
||||||
|
Marker: bm,
|
||||||
PayloadType: 96,
|
PayloadType: 96,
|
||||||
SequenceNumber: 17645,
|
SequenceNumber: 17645,
|
||||||
Timestamp: 2289527317,
|
Timestamp: 2289527317,
|
||||||
|
5
pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoder/5c3e3cea6fcbf660
vendored
Normal file
5
pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoder/5c3e3cea6fcbf660
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
[]byte("0\x00\x00\x00\x01\xff000\x00\x00@000000000000000000000000000000000000000000000000000000000000000000")
|
||||||
|
bool(true)
|
||||||
|
[]byte("0000\x01\xff000000000000000000000000000000000000000000000000000000000000000000000000")
|
||||||
|
bool(true)
|
@@ -1,3 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
[]byte("0\x00\x00\x00\x01\xff000\x00\x00@0000000000000000000000000000000000000000000000000000000000000000")
|
|
||||||
bool(true)
|
|
@@ -1,3 +1,5 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
|
[]byte("0")
|
||||||
|
bool(false)
|
||||||
[]byte("0\x00\x00\x00\x01\xff00")
|
[]byte("0\x00\x00\x00\x01\xff00")
|
||||||
bool(false)
|
bool(false)
|
@@ -1,5 +1,5 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
[]byte("")
|
[]byte("")
|
||||||
bool(false)
|
|
||||||
[]byte("")
|
|
||||||
bool(true)
|
bool(true)
|
||||||
|
[]byte("")
|
||||||
|
bool(false)
|
@@ -1,3 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
[]byte("0000\x01\xff00000000000000000000000000000000000000000000000000000000000000000000000")
|
|
||||||
bool(true)
|
|
@@ -1,3 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
[]byte("0000\x01\xff00")
|
|
||||||
bool(false)
|
|
5
pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoder/c582eb998d5b265e
vendored
Normal file
5
pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoder/c582eb998d5b265e
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
[]byte("0\x00\x00\x00\x01\xff000\x00\x00\x8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")
|
||||||
|
bool(false)
|
||||||
|
[]byte("0000\x01\xff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")
|
||||||
|
bool(false)
|
5
pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoder/f1b261959da64dfa
vendored
Normal file
5
pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoder/f1b261959da64dfa
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
[]byte("0")
|
||||||
|
bool(true)
|
||||||
|
[]byte("0\x00\x00\x00\x01\xff000\x00\x00\x8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")
|
||||||
|
bool(true)
|
@@ -1,3 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
[]byte("0000\x01\xff00000000000000000000000000000000000000000000000000000000000000000000000")
|
|
||||||
bool(false)
|
|
@@ -27,10 +27,10 @@ func TestDecode(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func FuzzDecoder(f *testing.F) {
|
func FuzzDecoder(f *testing.F) {
|
||||||
d := &Decoder{}
|
|
||||||
d.Init()
|
|
||||||
|
|
||||||
f.Fuzz(func(t *testing.T, a []byte, b []byte) {
|
f.Fuzz(func(t *testing.T, a []byte, b []byte) {
|
||||||
|
d := &Decoder{}
|
||||||
|
d.Init()
|
||||||
|
|
||||||
d.Decode(&rtp.Packet{
|
d.Decode(&rtp.Packet{
|
||||||
Header: rtp.Header{
|
Header: rtp.Header{
|
||||||
Version: 2,
|
Version: 2,
|
||||||
|
@@ -1,3 +1,3 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
[]byte("\x00\x00\x00\x000")
|
|
||||||
[]byte("0")
|
[]byte("0")
|
||||||
|
[]byte("\x00\x00\x00\x000")
|
3
pkg/formats/rtpmpeg2audio/testdata/fuzz/FuzzDecoder/364d148c8b01f9af
vendored
Normal file
3
pkg/formats/rtpmpeg2audio/testdata/fuzz/FuzzDecoder/364d148c8b01f9af
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
[]byte("\x00\x00\x00\x00\xff\xfd000")
|
||||||
|
[]byte("\x00\x00000")
|
@@ -1,3 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
[]byte("\x00\x00\x00\x05\xff\xff\x05000000000000000000000000000000000000000\xcf\x1c\xe9b\x01NUI00000000000000000000000000000000000000000000000000000000")
|
|
||||||
[]byte("\x00\x00\x00\x05\xff\xff\x0500")
|
|
@@ -1,3 +1,3 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
[]byte("0")
|
[]byte("0")
|
||||||
[]byte("\x00\x00\x00\x00\xff\xfa\x160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\xff\xfa000")
|
[]byte("\x00\x00\x00\x00\xff\xfb\x15000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\xff\xfb000")
|
@@ -1,2 +1,3 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
|
[]byte("0")
|
||||||
[]byte("")
|
[]byte("")
|
@@ -1,3 +1,3 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
[]byte("")
|
[]byte("0")
|
||||||
[]byte("00000")
|
[]byte("00000")
|
@@ -70,15 +70,15 @@ func TestDecodeADTS(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func FuzzDecoder(f *testing.F) {
|
func FuzzDecoder(f *testing.F) {
|
||||||
d := &Decoder{
|
|
||||||
SampleRate: 16000,
|
|
||||||
SizeLength: 13,
|
|
||||||
IndexLength: 3,
|
|
||||||
IndexDeltaLength: 3,
|
|
||||||
}
|
|
||||||
d.Init()
|
|
||||||
|
|
||||||
f.Fuzz(func(t *testing.T, a []byte, am bool, b []byte, bm bool) {
|
f.Fuzz(func(t *testing.T, a []byte, am bool, b []byte, bm bool) {
|
||||||
|
d := &Decoder{
|
||||||
|
SampleRate: 16000,
|
||||||
|
SizeLength: 13,
|
||||||
|
IndexLength: 3,
|
||||||
|
IndexDeltaLength: 3,
|
||||||
|
}
|
||||||
|
d.Init()
|
||||||
|
|
||||||
d.Decode(&rtp.Packet{
|
d.Decode(&rtp.Packet{
|
||||||
Header: rtp.Header{
|
Header: rtp.Header{
|
||||||
Version: 2,
|
Version: 2,
|
||||||
|
5
pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoder/0133a2a9bd638ceb
vendored
Normal file
5
pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoder/0133a2a9bd638ceb
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
[]byte("0")
|
||||||
|
bool(true)
|
||||||
|
[]byte("\x00\x1000")
|
||||||
|
bool(true)
|
5
pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoder/079a435e5445c35b
vendored
Normal file
5
pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoder/079a435e5445c35b
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
[]byte("")
|
||||||
|
bool(false)
|
||||||
|
[]byte("")
|
||||||
|
bool(false)
|
5
pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoder/571808e383aba6a5
vendored
Normal file
5
pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoder/571808e383aba6a5
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
[]byte("\x00\x01\x00\x00")
|
||||||
|
bool(false)
|
||||||
|
[]byte("\x00\x0100")
|
||||||
|
bool(false)
|
@@ -1,5 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
[]byte("\x000\x00\x00\xd8\xd8\xd8\xc8\xd8\xd801")
|
|
||||||
bool(true)
|
|
||||||
[]byte("\x00\x01\x00\x00")
|
|
||||||
bool(true)
|
|
@@ -1,5 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
[]byte("\x00000000000")
|
|
||||||
bool(false)
|
|
||||||
[]byte("")
|
|
||||||
bool(true)
|
|
5
pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoder/8f3e197fb87140b2
vendored
Normal file
5
pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoder/8f3e197fb87140b2
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
[]byte("\x00\x01\x00\x00")
|
||||||
|
bool(false)
|
||||||
|
[]byte("\x00 0000")
|
||||||
|
bool(true)
|
@@ -2,4 +2,4 @@ go test fuzz v1
|
|||||||
[]byte("00")
|
[]byte("00")
|
||||||
bool(false)
|
bool(false)
|
||||||
[]byte("")
|
[]byte("")
|
||||||
bool(true)
|
bool(false)
|
5
pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoder/97f31764971cea9c
vendored
Normal file
5
pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoder/97f31764971cea9c
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
[]byte("\x00 0000")
|
||||||
|
bool(false)
|
||||||
|
[]byte("0")
|
||||||
|
bool(true)
|
5
pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoder/a68704dd42c38106
vendored
Normal file
5
pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoder/a68704dd42c38106
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
[]byte("0")
|
||||||
|
bool(false)
|
||||||
|
[]byte("\x00\x0100")
|
||||||
|
bool(false)
|
@@ -1,5 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
[]byte("\x00\x10\x00\x00")
|
|
||||||
bool(false)
|
|
||||||
[]byte("\x00\x1000")
|
|
||||||
bool(false)
|
|
@@ -1,5 +1,5 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
[]byte("\x00\x00")
|
|
||||||
bool(false)
|
|
||||||
[]byte("")
|
[]byte("")
|
||||||
|
bool(false)
|
||||||
|
[]byte("\x00\x00")
|
||||||
bool(true)
|
bool(true)
|
@@ -27,14 +27,26 @@ func TestDecode(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func FuzzDecoder(f *testing.F) {
|
func FuzzDecoder(f *testing.F) {
|
||||||
d := &Decoder{}
|
f.Fuzz(func(t *testing.T, a []byte, am bool, b []byte, bm bool) {
|
||||||
d.Init()
|
d := &Decoder{}
|
||||||
|
d.Init()
|
||||||
|
|
||||||
f.Fuzz(func(t *testing.T, b []byte, m bool) {
|
|
||||||
d.Decode(&rtp.Packet{
|
d.Decode(&rtp.Packet{
|
||||||
Header: rtp.Header{
|
Header: rtp.Header{
|
||||||
Version: 2,
|
Version: 2,
|
||||||
Marker: m,
|
Marker: am,
|
||||||
|
PayloadType: 96,
|
||||||
|
SequenceNumber: 17645,
|
||||||
|
Timestamp: 2289527317,
|
||||||
|
SSRC: 0x9dbb7812,
|
||||||
|
},
|
||||||
|
Payload: a,
|
||||||
|
})
|
||||||
|
|
||||||
|
d.Decode(&rtp.Packet{
|
||||||
|
Header: rtp.Header{
|
||||||
|
Version: 2,
|
||||||
|
Marker: bm,
|
||||||
PayloadType: 96,
|
PayloadType: 96,
|
||||||
SequenceNumber: 17645,
|
SequenceNumber: 17645,
|
||||||
Timestamp: 2289527317,
|
Timestamp: 2289527317,
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
|
[]byte("")
|
||||||
|
bool(false)
|
||||||
[]byte("1000")
|
[]byte("1000")
|
||||||
bool(false)
|
bool(false)
|
5
pkg/formats/rtpvp8/testdata/fuzz/FuzzDecoder/079a435e5445c35b
vendored
Normal file
5
pkg/formats/rtpvp8/testdata/fuzz/FuzzDecoder/079a435e5445c35b
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
[]byte("")
|
||||||
|
bool(false)
|
||||||
|
[]byte("")
|
||||||
|
bool(false)
|
5
pkg/formats/rtpvp8/testdata/fuzz/FuzzDecoder/2b9461645a4b90d2
vendored
Normal file
5
pkg/formats/rtpvp8/testdata/fuzz/FuzzDecoder/2b9461645a4b90d2
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
[]byte("\xf8\x9a\x9f000")
|
||||||
|
bool(true)
|
||||||
|
[]byte(" 00000")
|
||||||
|
bool(false)
|
@@ -1,3 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
[]byte(" 000")
|
|
||||||
bool(false)
|
|
@@ -27,14 +27,26 @@ func TestDecode(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func FuzzDecoder(f *testing.F) {
|
func FuzzDecoder(f *testing.F) {
|
||||||
d := &Decoder{}
|
f.Fuzz(func(t *testing.T, a []byte, am bool, b []byte, bm bool) {
|
||||||
d.Init()
|
d := &Decoder{}
|
||||||
|
d.Init()
|
||||||
|
|
||||||
f.Fuzz(func(t *testing.T, b []byte, m bool) {
|
|
||||||
d.Decode(&rtp.Packet{
|
d.Decode(&rtp.Packet{
|
||||||
Header: rtp.Header{
|
Header: rtp.Header{
|
||||||
Version: 2,
|
Version: 2,
|
||||||
Marker: m,
|
Marker: am,
|
||||||
|
PayloadType: 96,
|
||||||
|
SequenceNumber: 17645,
|
||||||
|
Timestamp: 2289527317,
|
||||||
|
SSRC: 0x9dbb7812,
|
||||||
|
},
|
||||||
|
Payload: a,
|
||||||
|
})
|
||||||
|
|
||||||
|
d.Decode(&rtp.Packet{
|
||||||
|
Header: rtp.Header{
|
||||||
|
Version: 2,
|
||||||
|
Marker: bm,
|
||||||
PayloadType: 96,
|
PayloadType: 96,
|
||||||
SequenceNumber: 17645,
|
SequenceNumber: 17645,
|
||||||
Timestamp: 2289527317,
|
Timestamp: 2289527317,
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
[]byte("00")
|
[]byte("M")
|
||||||
bool(false)
|
|
||||||
[]byte("\x00\f00")
|
|
||||||
bool(true)
|
bool(true)
|
||||||
|
[]byte("A")
|
||||||
|
bool(false)
|
@@ -1,5 +1,5 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
[]byte("0")
|
[]byte("0")
|
||||||
bool(false)
|
bool(false)
|
||||||
[]byte("\x00\f00")
|
[]byte("")
|
||||||
bool(false)
|
bool(false)
|
@@ -1,3 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
[]byte("")
|
|
||||||
bool(true)
|
|
Reference in New Issue
Block a user