mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-11-26 07:14:20 +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:
1 parent
6bed5fc88c
commit
c95b95f5b7
1 file changed
+8
-1
@@ -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)); \
|
||||||
musicTracks.push_back(MusicTrack( rw )); \
|
if (rw == NULL) \
|
||||||
|
{ \
|
||||||
|
printf("Unable to read music file header: %s\n", SDL_GetError()); \
|
||||||
|
} \
|
||||||
|
else \
|
||||||
|
{ \
|
||||||
|
musicTracks.push_back(MusicTrack( rw )); \
|
||||||
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACK_NAMES
|
TRACK_NAMES
|
||||||
|
|||||||
Reference in new issue
Block a user