lavr: allocate the resampling buffer with a positive size

This fixes cases where very few input samples (fewer than needed for one
output sample) are passed to lavr at the beginning.
CC:libav-stable@libav.org
(cherry picked from commit ac976ed91e)
This commit is contained in:
Anton Khirnov 2014-03-20 20:40:24 +01:00 committed by Sean McGovern
parent 85b8b16917
commit dccac759d3

View File

@ -117,7 +117,7 @@ int avresample_open(AVAudioResampleContext *avr)
}
if (avr->resample_needed) {
avr->resample_out_buffer = ff_audio_data_alloc(avr->out_channels,
0, avr->internal_sample_fmt,
1024, avr->internal_sample_fmt,
"resample_out_buffer");
if (!avr->resample_out_buffer) {
ret = AVERROR(EINVAL);