Explorar el Código

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 hace 1 año
cometido por GitHub
padre
commit
289e7d3a6c
No se encontró ninguna clave conocida en la base de datos para esta firma ID de clave GPG: B5690EEEBB952194
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. +2
    -0
      src/raudio.c

+ 2
- 0
src/raudio.c Ver fichero

@ -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

Cargando…
Cancelar
Guardar