mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
exidy440: fix invalid array access
This commit is contained in:
parent
cf4d1487bf
commit
80d59e420a
@ -554,7 +554,7 @@ int16_t *exidy440_sound_device::find_or_add_to_sound_cache(int address, int leng
|
||||
if (current.address == address && current.length == length && current.bits == bits && current.frequency == frequency)
|
||||
return ¤t.data[0];
|
||||
|
||||
return add_to_sound_cache(&m_samples[address], address, length, bits, frequency);
|
||||
return length ? add_to_sound_cache(&m_samples[address], address, length, bits, frequency) : nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -584,8 +584,6 @@ void exidy440_sound_device::play_cvsd(int ch)
|
||||
|
||||
/* compute the base address in the converted samples array */
|
||||
base = find_or_add_to_sound_cache(address, length, channel_bits[ch], m_channel_frequency[ch]);
|
||||
if (!base)
|
||||
return;
|
||||
|
||||
/* if the length is 0 or 1, just do an immediate end */
|
||||
if (length <= 3)
|
||||
|
@ -73,7 +73,6 @@ private:
|
||||
uint8_t m_sound_command_ack;
|
||||
|
||||
uint8_t m_sound_banks[4];
|
||||
//uint8_t m_m6844_data[0x20];
|
||||
uint8_t m_sound_volume[0x10];
|
||||
std::vector<int32_t> m_mixer_buffer_left;
|
||||
std::vector<int32_t> m_mixer_buffer_right;
|
||||
|
Loading…
Reference in New Issue
Block a user