From 91fe6f5e1396bd7df569947e32b709f599a5728f Mon Sep 17 00:00:00 2001 From: yexo Date: Thu, 28 May 2009 16:43:16 +0000 Subject: (svn r16455) -Fix: don't crash when a newgrf has sounds in an unsupported sound format --- src/newgrf_sound.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/newgrf_sound.cpp') 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 _sounds; @@ -16,7 +17,9 @@ static SmallVector _sounds; /* Allocate a new Sound */ SoundEntry *AllocateSound() { - return _sounds.Append(); + SoundEntry *sound = _sounds.Append(); + MemSetT(sound, 0); + return sound; } -- cgit v1.2.3-54-g00ecf