diff options
author | yexo <yexo@openttd.org> | 2009-05-28 16:43:16 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2009-05-28 16:43:16 +0000 |
commit | 91fe6f5e1396bd7df569947e32b709f599a5728f (patch) | |
tree | 28f7a0a69e638a2b4ffd88d15734ceaa3df99864 /src | |
parent | 9bd64cf588a6915b2662df26ffb54c80d61bbd11 (diff) | |
download | openttd-91fe6f5e1396bd7df569947e32b709f599a5728f.tar.xz |
(svn r16455) -Fix: don't crash when a newgrf has sounds in an unsupported sound format
Diffstat (limited to 'src')
-rw-r--r-- | src/newgrf_sound.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/newgrf_sound.cpp b/src/newgrf_sound.cpp index ffdddd5ca..f8eb1c79b 100644 --- a/src/newgrf_sound.cpp +++ b/src/newgrf_sound.cpp @@ -9,6 +9,7 @@ #include "vehicle_base.h" #include "sound_func.h" #include "core/smallvec_type.hpp" +#include "core/mem_func.hpp" static SmallVector<SoundEntry, ORIGINAL_SAMPLE_COUNT> _sounds; @@ -16,7 +17,9 @@ static SmallVector<SoundEntry, ORIGINAL_SAMPLE_COUNT> _sounds; /* Allocate a new Sound */ SoundEntry *AllocateSound() { - return _sounds.Append(); + SoundEntry *sound = _sounds.Append(); + MemSetT(sound, 0); + return sound; } |