mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Check rw
in musicclass::init()
It's possible that SDL_RWFromMem could return NULL, and if this is the case, then we really shouldn't be passing it to MusicTrack().
This commit is contained in:
parent
6bed5fc88c
commit
c95b95f5b7
1 changed files with 8 additions and 1 deletions
|
@ -83,7 +83,14 @@ void musicclass::init()
|
|||
if (index >= 0 && index < musicReadBlob.max_headers) \
|
||||
{ \
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index)); \
|
||||
if (rw == NULL) \
|
||||
{ \
|
||||
printf("Unable to read music file header: %s\n", SDL_GetError()); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
musicTracks.push_back(MusicTrack( rw )); \
|
||||
} \
|
||||
}
|
||||
|
||||
TRACK_NAMES
|
||||
|
|
Loading…
Reference in a new issue