On Tue, Apr 28, 2015 at 12:55 AM, Luca Barbato <[email protected]> wrote:
> Bug-Id: 825
> CC: [email protected]
> ---
>  libavresample/resample.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/libavresample/resample.c b/libavresample/resample.c
> index bf766a2..86a761b 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);
> --
> 2.3.2

Probably ok, might be nice to have 1 line in the commit log explaining
it though.
-- 
Vittorio
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to