[MAD Decoder] Fix crash on invalid files
The properties function should not be dereferencing an invalid index into the layer codec name array if layer is not set to 1 through 3. This could happen if, for instance, an MP3 file has an invalid ID3v2 tag. Signed-off-by: Christopher Snowhill <kode54@gmail.com>swiftingly
parent
ffdb6262c2
commit
1c9887053c
|
@ -756,6 +756,7 @@
|
|||
}
|
||||
|
||||
- (NSDictionary *)properties {
|
||||
if(layer < 1 || layer > 3) return nil;
|
||||
const NSString *layers[3] = { @"MP1", @"MP2", @"MP3" };
|
||||
return @{ @"channels": [NSNumber numberWithInt:channels],
|
||||
@"bitsPerSample": [NSNumber numberWithInt:32],
|
||||
|
|
Loading…
Reference in New Issue