Skip to content

Commit

Permalink
Skip digi_sync_sounds loop if !Viewer
Browse files Browse the repository at this point in the history
If a sound is used, it may dereference Viewer.  If Viewer is null, this
will crash.  In 630f119,
digi_sync_sounds changed to assume Viewer is valid.  This crashes during
early startup when not using the SDL_mixer backend, even though no
sounds are in use.

Reported-by: derhass <#45>
Fixes: 630f119 ("Cache Viewer in digiobj")
  • Loading branch information
vLKp committed Mar 15, 2015
1 parent ac39b6c commit 2458078
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions similar/main/digiobj.cpp
Expand Up @@ -530,6 +530,8 @@ void digi_sync_sounds()
}

SoundQ_process();
if (!Viewer)
return;
const vcobjptr_t viewer{Viewer};
range_for (auto &s, SoundObjects)
{
Expand Down

0 comments on commit 2458078

Please sign in to comment.