This repository has been archived by the owner on Apr 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 81
/
fuzzing_test.go
107 lines (104 loc) · 3.44 KB
/
fuzzing_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// Copyright 2017 Hajime Hoshi
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package mp3
import (
"bytes"
"testing"
)
func TestFuzzing(t *testing.T) {
inputs := []string{
// #3
"\xff\xfa500000000000\xff\xff0000" +
"00000000000000000000" +
"00000000000000000000" +
"00000000000000000000" +
"00000000000000000000" +
"00000000000000000000" +
"00000000000000000000" +
"0000",
"\xff\xfb\x100004000094\xff000000" +
"00000000000000000000" +
"00\u007f0\xff\xee\u007f\xff\xee\u007f\xff\xff\u007f\xff\xff\xee\u007f\xff\xff0" +
"\xff\xff00\xff\xee\u007f\xff0000\u007f00\xff00\xee0" +
"000\xff000\xff\xff\xee\u007f0\xff0000\u007f\xff0" +
"00\xff0",
"\xff\xfb\x100004000094\xff000000" +
"00000000000000000000" +
"00\u007f0\xff\xee\u007f\xff\xee\u007f\xff\xff\u007f\xff\xff\xee\u007f\xff\xff\u007f" +
"\xff\xff\u007f0\xff\xee\u007f\xff0000\u007f00\xff\xff\xee\xee0" +
"0\xee\u007f\xff000\xff\xff\xee\u007f0\xff0000\u007f\xff0" +
"0\xff\xff0",
"\xff\xfa\x1000000000000000000" +
"00000000000000000000" +
"000000000000000000\xff\xff" +
"0\u007f\xff\xff\u007f\xff\xff\u007f\xff\xff\xfc0\xff\xef\xbf0\xef\xbf00" +
"0\xff\xee\u007f\xff\xff\u007f\xff\xff\xee\u007f\xff\xff\u007f\xff\xff\u007f\xff00" +
"\xff\xff00",
"\xff\xfa00000031000000000n" +
"s0f00000000000000000" +
"00000000000000000000" +
"00000000000000000000" +
"00000000000000000000" +
"00000000000000000000" +
"00000000000000000000" +
"00000000\u007f\xff\xff000\xff\xee",
"\xff\xfa\x1000000000000000000" +
"00000000000000000000" +
"00000000000000000000" +
"00000000000000\xbf0\xef\xbf00" +
"0\xff\xee0\xff\xff\u007f\xff\xff\xee\u007f\xff\xff\u007f\xff\xff\u007f\xff00" +
"\xff0\xee0",
"\xff\xfa\x100000050000000000\u007f" +
"00000000000000000000" +
"0000000000\xee\u007f0\xff\xff\xff\xff\u007f\xff\xff" +
"\xee\u007f\xff\xff\u007f\xff\xff\u007f\xff\xff\xfc\xee\xff\xef\xbf0\xef\xbf00" +
"0\xff\xee\u007f\xff\xff\u007f\xff\xff\xee\u007f\xff\xff\u007f\xff\xff\u007f\xff0\t" +
"\xff\xff\xee\xee",
// #22
"\xff\xfa%00000000000000000" +
"000000000000s0000000" +
"00000000000000000000" +
"00000000000000000000" +
"00000000000000000000" +
"00000000000000000000",
// #23
"\xff\xfb%S000000v000\x00\x010000" +
"00000000000000000000" +
"0000\xf4000000000000000" +
"00000000000000000000" +
"00000000000000000000" +
"00000000000000000000",
// #24
"\xff\xfb0x000000\xf9000\x00\x030000" +
"000000000000\xf70000000" +
"\x900000000000000000000" +
"00000000000000000000" +
"00000000000000000000" +
"00000000000000000000" +
"00000000000000000000" +
"00000000000000000000" +
"00000000000000000000" +
"00000000000000000000" +
"00000000000000000000" +
"00000000000000000000" +
"00000000000000000000" +
"00000000000000000000" +
"00000000000000000000" +
"0000000000000",
}
for _, input := range inputs {
b := bytes.NewReader([]byte(input))
_, _ = NewDecoder(b)
}
}