aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/resample.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-27 15:26:45 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-11-06 19:49:12 +0100
commit8bd374858f860e73157768b102cebe96116e688d (patch)
treeec816e95ea07753d42d40dc733bb9dca1566ab1a /libavcodec/resample.c
parentd39cc3c092936896d787c29d7e215a273e22a57e (diff)
downloadffmpeg-8bd374858f860e73157768b102cebe96116e688d.tar.gz
resample: Fix array size
Found-by: Jim Radford Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 3e7db0a9ee758bf0570a141be1fea64f8d9c03db) Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit edf3c5a3ebeee8df55c6a05f88a682091f10a364) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/resample.c')
-rw-r--r--libavcodec/resample.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/resample.c b/libavcodec/resample.c
index 829db76570..c40f7225c2 100644
--- a/libavcodec/resample.c
+++ b/libavcodec/resample.c
@@ -279,9 +279,9 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl
if (s->sample_fmt[1] != SAMPLE_FMT_S16) {
output_bak = output;
- if (!s->buffer_size[1] || s->buffer_size[1] < lenout) {
+ if (!s->buffer_size[1] || s->buffer_size[1] < 2*lenout) {
av_free(s->buffer[1]);
- s->buffer_size[1] = lenout;
+ s->buffer_size[1] = 2*lenout;
s->buffer[1] = av_malloc(s->buffer_size[1]);
if (!s->buffer[1]) {
av_log(s, AV_LOG_ERROR, "Could not allocate buffer\n");