changeset 12048:4a1df505252a draft

(svn r16455) -Fix: don't crash when a newgrf has sounds in an unsupported sound format
author yexo <yexo@openttd.org>
date Thu, 28 May 2009 16:43:16 +0000
parents 777e9d7a1480
children f7f7e8dd44c7
files src/newgrf_sound.cpp
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
 /* Allocate a new Sound */
 SoundEntry *AllocateSound()
 {
-	return _sounds.Append();
+	SoundEntry *sound = _sounds.Append();
+	MemSetT(sound, 0);
+	return sound;
 }