From ef41e269f12e571ade1c167fd9a7555ad095731c Mon Sep 17 00:00:00 2001 From: Bruce Pascoe Date: Mon, 30 Apr 2018 12:32:21 -0400 Subject: [PATCH] Fix verbosity level 3+ segfault I accidentally used `%s` in a printf format string instead of `%u` which invariably caused the engine to crash. This has probably been an issue for a long time but I never use the higher logging levels so it went unnoticed. --- CHANGELOG.md | 1 + msvs/minisphere.vcxproj | 6 +++--- src/minisphere/audio.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d34c09c08..4a9d567cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ v5.2.2 - TBD * Fixes a regression in 5.2.0 which causes miniSphere to crash or otherwise misbehave when run with no command-line arguments. +* Fixes a segfault when stopping a sound at verbosity level 3 or higher. v5.2.1 - April 29, 2018 ----------------------- diff --git a/msvs/minisphere.vcxproj b/msvs/minisphere.vcxproj index 21a6f9e78..4683addf8 100644 --- a/msvs/minisphere.vcxproj +++ b/msvs/minisphere.vcxproj @@ -132,7 +132,7 @@ Level3 Disabled - MINISPHERE_SPHERUN1;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + MINISPHERE_SPHERUN;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) MultiThreadedDebug ProgramDatabase false @@ -163,12 +163,12 @@ xcopy /y /d /e /f "lib\*.dll" "$(OutDir)" WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) MultiThreaded true - None ..\src\minisphere;include;..\src\shared AnySuitable false + None Windows @@ -197,12 +197,12 @@ xcopy /y /d /e /f "lib\*.dll" "$(OutDir)" MINISPHERE_SPHERUN;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) MultiThreaded true - None ..\src\minisphere;include;..\src\shared AnySuitable false + None Console diff --git a/src/minisphere/audio.c b/src/minisphere/audio.c index 37aa3c5ae..367e06652 100644 --- a/src/minisphere/audio.c +++ b/src/minisphere/audio.c @@ -611,7 +611,7 @@ sound_seek(sound_t* sound, double position) void sound_stop(sound_t* sound) { - console_log(3, "stopping playback of sound #%s", sound->id); + console_log(3, "stopping playback of sound #%u", sound->id); if (sound->stream == NULL) return; al_set_audio_stream_playing(sound->stream, false);