瀏覽代碼

Reset music.ctxType if loading wasn't succesful (#3917)

Fixes some crashes, e.g. calling StopMusicStream after trying to load Music from a non-existant .mp3 file
pull/3919/head
veins1 1 年之前
committed by GitHub
父節點
當前提交
289e7d3a6c
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: B5690EEEBB952194
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. +2
    -0
      src/raudio.c

+ 2
- 0
src/raudio.c 查看文件

@ -1461,6 +1461,7 @@ Music LoadMusicStream(const char *fileName)
#endif
music.ctxData = NULL;
music.ctxType = MUSIC_AUDIO_NONE;
TRACELOG(LOG_WARNING, "FILEIO: [%s] Music file could not be opened", fileName);
}
else
@ -1670,6 +1671,7 @@ Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data,
#endif
music.ctxData = NULL;
music.ctxType = MUSIC_AUDIO_NONE;
TRACELOG(LOG_WARNING, "FILEIO: Music data could not be loaded");
}
else

Loading…
取消
儲存