Added error check for GME plugin to stop crashes on unsupported files.

CQTexperiment
vspader 2009-07-15 19:11:55 -07:00
parent a531e31d42
commit 90ae894156
1 changed files with 5 additions and 2 deletions

View File

@ -31,9 +31,12 @@
return nil;
}
gme_err_t error;
Music_Emu *emu;
error = gme_open_file([[url path] UTF8String], &emu, 44100);
gme_err_t error = gme_open_file([[url path] UTF8String], &emu, 44100);
if (NULL != error) {
NSLog(@"GME: Error loading file: %@ %s", [url path], error);
return [NSArray arrayWithObject:url];
}
int track_count = gme_track_count(emu);
NSMutableArray *tracks = [NSMutableArray array];