mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-22 12:05:11 +00:00
Fix crash when loading custom audio on client
This commit is contained in:
parent
4bc13ef275
commit
5e86a3e9ac
1 changed files with 7 additions and 0 deletions
|
@ -223,6 +223,13 @@ struct BassAudio* audio_load_internal(const char* filename, bool isStream) {
|
|||
bassAudio->file = modFile;
|
||||
|
||||
// copy audio into rawData
|
||||
if (modFile->fp == NULL) {
|
||||
modFile->fp = fopen(modFile->cachedPath, "rb");
|
||||
if (modFile->fp == NULL) {
|
||||
LOG_ERROR("Could not open mod file: %s", modFile->cachedPath);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
rewind(modFile->fp);
|
||||
bassAudio->rawData = (char*)malloc(modFile->size * sizeof(char));
|
||||
fread(bassAudio->rawData, modFile->size, 1, modFile->fp);
|
||||
|
|
Loading…
Reference in a new issue