Added error checking to SID tune loading
parent
a6b6369a6d
commit
18dac8e493
|
@ -53,6 +53,9 @@
|
|||
|
||||
SidTune * tune = new SidTune( (const uint_least8_t*)data, size );
|
||||
|
||||
if (!tune->getStatus())
|
||||
return 0;
|
||||
|
||||
const SidTuneInfo * info = tune->getInfo();
|
||||
|
||||
unsigned int subsongs = info->songs();
|
||||
|
|
|
@ -31,6 +31,9 @@
|
|||
|
||||
tune = new SidTune((const uint_least8_t *)data, (uint_least32_t)size);
|
||||
|
||||
if (!tune->getStatus())
|
||||
return NO;
|
||||
|
||||
NSURL * url = [s url];
|
||||
int track_num;
|
||||
if ([[url fragment] length] == 0)
|
||||
|
@ -50,7 +53,7 @@
|
|||
|
||||
engine->setRoms( kernel, basic, chargen );
|
||||
|
||||
if ( engine->load( tune ) < 0 )
|
||||
if ( !engine->load( tune ) )
|
||||
return NO;
|
||||
|
||||
ReSIDfpBuilder * _builder = new ReSIDfpBuilder("ReSIDfp");
|
||||
|
|
|
@ -47,6 +47,10 @@
|
|||
[source read:data amount:size];
|
||||
|
||||
SidTune * tune = new SidTune( (const uint_least8_t *)data, (uint_least32_t)size );
|
||||
|
||||
if (!tune->getStatus())
|
||||
return 0;
|
||||
|
||||
const SidTuneInfo * info = tune->getInfo();
|
||||
|
||||
unsigned int count = info->numberOfInfoStrings();
|
||||
|
|
Loading…
Reference in New Issue