MSVC: Fix stack allocation
Maybe it *was* a bit late last night... ;-)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user