[FFmpeg-devel] [PATCH] lavfi/af_atempo: clear references before returning error.

Pavel Koshevoy pkoshevoy at gmail.com
Thu Mar 6 16:35:53 CET 2014


On 3/5/14, 10:03, Nicolas George wrote:
> Once the frame has been given to ff_filter_frame(), it can
> no longer be used, even on error.
>
> Fix trac ticket #3430.
>
> Signed-off-by: Nicolas George <george at nsup.org>
> ---
>   libavfilter/af_atempo.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavfilter/af_atempo.c b/libavfilter/af_atempo.c
> index c474d6a..6a3fd61 100644
> --- a/libavfilter/af_atempo.c
> +++ b/libavfilter/af_atempo.c
> @@ -1058,11 +1058,11 @@ static int push_samples(ATempoContext *atempo,
>                        outlink->time_base);
>   
>       ret = ff_filter_frame(outlink, atempo->dst_buffer);
> -    if (ret < 0)
> -        return ret;
>       atempo->dst_buffer = NULL;
>       atempo->dst        = NULL;
>       atempo->dst_end    = NULL;
> +    if (ret < 0)
> +        return ret;
>   
>       atempo->nsamples_out += n_out;
>       return 0;


It's a little disturbing that ff_filter_frame returned an error, so I'd 
like to know what caused it.  I'll have to poke around in the debugger 
tonight (in about 12 hours).

However, you don't need to wait for me.  I'll send another patch if I 
find anything.

Thank you,
     Pavel.



More information about the ffmpeg-devel mailing list