Commit 3e7db0a9 authored by Michael Niedermayer's avatar Michael Niedermayer

resample: Fix array size

Found-by: Jim Radford
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 1b9ca38d
...@@ -325,9 +325,9 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl ...@@ -325,9 +325,9 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl
if (s->sample_fmt[1] != AV_SAMPLE_FMT_S16) { if (s->sample_fmt[1] != AV_SAMPLE_FMT_S16) {
output_bak = output; 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]); 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]); s->buffer[1] = av_malloc(s->buffer_size[1]);
if (!s->buffer[1]) { if (!s->buffer[1]) {
av_log(s->resample_context, AV_LOG_ERROR, "Could not allocate buffer\n"); av_log(s->resample_context, AV_LOG_ERROR, "Could not allocate buffer\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment