MSVC: Fix stack allocation

Maybe it *was* a bit late last night... ;-)
This commit is contained in:
darkstar
2018-02-22 19:07:04 +01:00
parent 0fbe93e320
commit f0193aa38c
2 changed files with 3 additions and 3 deletions

View File

@@ -692,7 +692,7 @@ static void adgold_get_buffer(int32_t *buffer, int len, void *p)
pclog("adgold_get_buffer: possible stack overflow detected. Buffer size was %d bytes", 2 * len);
return;
}
int16_t *adgold_buffer = (int16_t *)_alloca(len * 2);
int16_t *adgold_buffer = (int16_t *)_alloca(sizeof(int16_t) * len * 2);
#else
int16_t adgold_buffer[len*2];
#endif

View File

@@ -200,7 +200,7 @@ void opl2_update(int nr, int16_t *buffer, int samples)
pclog("opl2_update: possible stack overflow detected. sample count was %d", samples);
return;
}
Bit32s *buffer_32 = (Bit32s *)_alloca(samples);
Bit32s *buffer_32 = (Bit32s *)_alloca(sizeof(Bit32s) * samples);
#else
Bit32s buffer_32[samples];
#endif
@@ -221,7 +221,7 @@ void opl3_update(int nr, int16_t *buffer, int samples)
pclog("opl2_update: possible stack overflow detected. sample count was %d", samples);
return;
}
Bit32s *buffer_32 = (Bit32s *)_alloca(samples);
Bit32s *buffer_32 = (Bit32s *)_alloca(sizeof(Bit32s) * samples);
#else
Bit32s buffer_32[samples*2];
#endif