(svn r16455) -Fix: don't crash when a newgrf has sounds in an unsupported sound format
This commit is contained in:
		@@ -9,6 +9,7 @@
 | 
				
			|||||||
#include "vehicle_base.h"
 | 
					#include "vehicle_base.h"
 | 
				
			||||||
#include "sound_func.h"
 | 
					#include "sound_func.h"
 | 
				
			||||||
#include "core/smallvec_type.hpp"
 | 
					#include "core/smallvec_type.hpp"
 | 
				
			||||||
 | 
					#include "core/mem_func.hpp"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static SmallVector<SoundEntry, ORIGINAL_SAMPLE_COUNT> _sounds;
 | 
					static SmallVector<SoundEntry, ORIGINAL_SAMPLE_COUNT> _sounds;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -16,7 +17,9 @@ static SmallVector<SoundEntry, ORIGINAL_SAMPLE_COUNT> _sounds;
 | 
				
			|||||||
/* Allocate a new Sound */
 | 
					/* Allocate a new Sound */
 | 
				
			||||||
SoundEntry *AllocateSound()
 | 
					SoundEntry *AllocateSound()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	return _sounds.Append();
 | 
						SoundEntry *sound = _sounds.Append();
 | 
				
			||||||
 | 
						MemSetT(sound, 0);
 | 
				
			||||||
 | 
						return sound;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user