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>
... | ... |
@@ -279,9 +279,9 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl |
279 | 279 |
if (s->sample_fmt[1] != SAMPLE_FMT_S16) { |
280 | 280 |
output_bak = output; |
281 | 281 |
|
282 |
- if (!s->buffer_size[1] || s->buffer_size[1] < lenout) { |
|
282 |
+ if (!s->buffer_size[1] || s->buffer_size[1] < 2*lenout) { |
|
283 | 283 |
av_free(s->buffer[1]); |
284 |
- s->buffer_size[1] = lenout; |
|
284 |
+ s->buffer_size[1] = 2*lenout; |
|
285 | 285 |
s->buffer[1] = av_malloc(s->buffer_size[1]); |
286 | 286 |
if (!s->buffer[1]) { |
287 | 287 |
av_log(s, AV_LOG_ERROR, "Could not allocate buffer\n"); |