diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-04-29 06:46:20 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-04-29 06:46:35 +0300 |
commit | 215430e049b78fc4c3d1cb8f6086bcd4bae0375e (patch) | |
tree | 0c9e554b3328f6d46341ec51724a221c398cfd29 | |
parent | 639781492684fcad05da52e7700bcbf6086599ea (diff) | |
parent | 0ac8ff618c5e6d878c547a8877e714ed728950ce (diff) |
Merge commit '0ac8ff618c5e6d878c547a8877e714ed728950ce'
* commit '0ac8ff618c5e6d878c547a8877e714ed728950ce':
avresample: Reallocate the internal buffer to the correct size
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavresample/resample.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavresample/resample.c b/libavresample/resample.c index 674336d3a9..01fc50014d 100644 --- a/libavresample/resample.c +++ b/libavresample/resample.c @@ -434,7 +434,9 @@ int ff_audio_resample(ResampleContext *c, AudioData *dst, AudioData *src) int bps = av_get_bytes_per_sample(c->avr->internal_sample_fmt); int i; - ret = ff_audio_data_realloc(c->buffer, in_samples + c->padding_size); + ret = ff_audio_data_realloc(c->buffer, + FFMAX(in_samples, in_leftover) + + c->padding_size); if (ret < 0) { av_log(c->avr, AV_LOG_ERROR, "Error reallocating resampling buffer\n"); return AVERROR(ENOMEM); |