Skip to content

Commit

Permalink
Fix verbosity level 3+ segfault
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fatcerberus committed Apr 30, 2018
1 parent d727df1 commit ef41e26
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----------------------
Expand Down
6 changes: 3 additions & 3 deletions msvs/minisphere.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>MINISPHERE_SPHERUN1;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>MINISPHERE_SPHERUN;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<BufferSecurityCheck>false</BufferSecurityCheck>
Expand Down Expand Up @@ -163,12 +163,12 @@ xcopy /y /d /e /f "lib\*.dll" "$(OutDir)"</Command>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<DebugInformationFormat>None</DebugInformationFormat>
<DisableSpecificWarnings>
</DisableSpecificWarnings>
<AdditionalIncludeDirectories>..\src\minisphere;include;..\src\shared</AdditionalIncludeDirectories>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<BufferSecurityCheck>false</BufferSecurityCheck>
<DebugInformationFormat>None</DebugInformationFormat>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand Down Expand Up @@ -197,12 +197,12 @@ xcopy /y /d /e /f "lib\*.dll" "$(OutDir)"</Command>
<PreprocessorDefinitions>MINISPHERE_SPHERUN;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<DebugInformationFormat>None</DebugInformationFormat>
<DisableSpecificWarnings>
</DisableSpecificWarnings>
<AdditionalIncludeDirectories>..\src\minisphere;include;..\src\shared</AdditionalIncludeDirectories>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<BufferSecurityCheck>false</BufferSecurityCheck>
<DebugInformationFormat>None</DebugInformationFormat>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand Down
2 changes: 1 addition & 1 deletion src/minisphere/audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ef41e26

Please sign in to comment.