summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2009-08-25 17:40:44 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2009-08-27 10:44:52 +0200
commit9d254679649fe3810ec9885251999a084bb7bacb (patch)
tree6e0fb31fc22a04b4274005667716781d2adc2270
parent509d9f04e56258e8bcb59b0bb42e84053ba6021c (diff)
sample-util: avoid stack overrun
The linear volume array needs enough padding when preparing the volumes for mixing.
-rw-r--r--src/pulsecore/sample-util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pulsecore/sample-util.c b/src/pulsecore/sample-util.c
index 6e97e5a9..5fae1928 100644
--- a/src/pulsecore/sample-util.c
+++ b/src/pulsecore/sample-util.c
@@ -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) {
unsigned k, channel;
- float linear[PA_CHANNELS_MAX];
+ float linear[PA_CHANNELS_MAX + VOLUME_PADDING];
pa_assert(streams);
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) {
unsigned k, channel;
- float linear[PA_CHANNELS_MAX];
+ float linear[PA_CHANNELS_MAX + VOLUME_PADDING];
pa_assert(streams);
pa_assert(spec);