sample-util: avoid stack overrun

The linear volume array needs enough padding when preparing the volumes for
mixing.
This commit is contained in:
Wim Taymans 2009-08-25 17:40:44 +02:00
parent 509d9f04e5
commit 9d25467964

View file

@ -137,7 +137,7 @@ static void calc_linear_float_volume(float linear[], const pa_cvolume *volume) {
static void calc_linear_integer_stream_volumes(pa_mix_info streams[], unsigned nstreams, const pa_cvolume *volume, const pa_sample_spec *spec) { static void calc_linear_integer_stream_volumes(pa_mix_info streams[], unsigned nstreams, const pa_cvolume *volume, const pa_sample_spec *spec) {
unsigned k, channel; unsigned k, channel;
float linear[PA_CHANNELS_MAX]; float linear[PA_CHANNELS_MAX + VOLUME_PADDING];
pa_assert(streams); pa_assert(streams);
pa_assert(spec); pa_assert(spec);
@ -156,7 +156,7 @@ static void calc_linear_integer_stream_volumes(pa_mix_info streams[], unsigned n
static void calc_linear_float_stream_volumes(pa_mix_info streams[], unsigned nstreams, const pa_cvolume *volume, const pa_sample_spec *spec) { static void calc_linear_float_stream_volumes(pa_mix_info streams[], unsigned nstreams, const pa_cvolume *volume, const pa_sample_spec *spec) {
unsigned k, channel; unsigned k, channel;
float linear[PA_CHANNELS_MAX]; float linear[PA_CHANNELS_MAX + VOLUME_PADDING];
pa_assert(streams); pa_assert(streams);
pa_assert(spec); pa_assert(spec);