diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-10-27 15:26:45 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-10-27 15:27:32 +0200 |
commit | 3e7db0a9ee758bf0570a141be1fea64f8d9c03db (patch) | |
tree | c93ea515396ff4c824c38256b3ff79d4e0392c03 | |
parent | 1b9ca38d9d06d319fffd61d27e4eb385d6572ba8 (diff) | |
download | ffmpeg-3e7db0a9ee758bf0570a141be1fea64f8d9c03db.tar.gz |
resample: Fix array size
Found-by: Jim Radford
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/resample.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/resample.c b/libavcodec/resample.c index b5be910672..f1a2dbf6dc 100644 --- a/libavcodec/resample.c +++ b/libavcodec/resample.c @@ -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) { 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->resample_context, AV_LOG_ERROR, "Could not allocate buffer\n"); |