mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03: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:
@@ -83,7 +83,14 @@ void musicclass::init()
|
|||||||
if (index >= 0 && index < musicReadBlob.max_headers) \
|
if (index >= 0 && index < musicReadBlob.max_headers) \
|
||||||
{ \
|
{ \
|
||||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index)); \
|
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 )); \
|
musicTracks.push_back(MusicTrack( rw )); \
|
||||||
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACK_NAMES
|
TRACK_NAMES
|
||||||
|
|||||||
Reference in New Issue
Block a user