File tree Expand file tree Collapse file tree 1 file changed +25
-3
lines changed Expand file tree Collapse file tree 1 file changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ static void Main(string[] args)
52
52
}
53
53
}
54
54
55
+ /*
55
56
for (int i = 0; i < XISO_LENGTH.Length; i++)
56
57
{
57
58
if (XISO_LENGTH[i] == isoSize)
@@ -61,6 +62,13 @@ static void Main(string[] args)
61
62
break;
62
63
}
63
64
}
65
+ */
66
+
67
+ if ( xgdType == null )
68
+ {
69
+ Console . WriteLine ( "Unexpected ISO size. Is this a valid redump ISO?" ) ;
70
+ return ;
71
+ }
64
72
65
73
// Compare PVD against known PVDs to determine wave
66
74
int ? wave = null ;
@@ -130,13 +138,20 @@ static void Main(string[] args)
130
138
19 => 12 ,
131
139
20 => 13 ,
132
140
21 => 14 ,
133
- _ => 16 ,
141
+ _ => - 1 ,
134
142
} ,
135
143
5 => 14 ,
136
144
6 => 15 ,
137
- 7 or _ => 16 ,
145
+ 7 => 16 ,
146
+ _ => - 1 ,
138
147
} ;
139
148
149
+ if ( videoType == - 1 )
150
+ {
151
+ Console . WriteLine ( "Unexpected video partition. Cannot determine wave" ) ;
152
+ return ;
153
+ }
154
+
140
155
long l0Length = VIDEO_L0_LENGTH [ videoType ] ;
141
156
long l1Length = VIDEO_L1_LENGTH [ videoType ] ;
142
157
@@ -183,9 +198,16 @@ static void Main(string[] args)
183
198
0 => 0 ,
184
199
1 or 2 or 3 or 4 => 1 ,
185
200
5 => 2 ,
186
- 6 or 7 or _ => 3 ,
201
+ 6 or 7 => 3 ,
202
+ _ => - 1 ,
187
203
} ;
188
204
205
+ if ( xisoType == - 1 )
206
+ {
207
+ Console . WriteLine ( "Unexpected ISO size. Is this a valid redump ISO?" ) ;
208
+ return ;
209
+ }
210
+
189
211
isoFS . Seek ( XISO_OFFSET [ xisoType ] , SeekOrigin . Begin ) ;
190
212
191
213
byte [ ] buf = new byte [ 1024 * 2048 ] ;
You can’t perform that action at this time.
0 commit comments