[FFmpeg-devel] [PATCH] lavfi: fix null checking in avfilter_config_links()

Stefano Sabatini stefasab at gmail.com
Sun Jan 20 23:41:03 CET 2013


On date Sunday 2013-01-20 15:38:21 -0500, Xi Wang encoded:
> Move the first use of `link' after the null pointer check.
> 
> Signed-off-by: Xi Wang <xi.wang at gmail.com>
> ---
>  libavfilter/avfilter.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
> index 8c06173..4759d13 100644
> --- a/libavfilter/avfilter.c
> +++ b/libavfilter/avfilter.c
> @@ -222,11 +222,11 @@ int avfilter_config_links(AVFilterContext *filter)
>  
>      for (i = 0; i < filter->nb_inputs; i ++) {
>          AVFilterLink *link = filter->inputs[i];
> -        AVFilterLink *inlink = link->src->nb_inputs ?
> -            link->src->inputs[0] : NULL;
> +        AVFilterLink *inlink;
>  
>          if (!link) continue;
>  
> +        inlink = link->src->nb_inputs ? link->src->inputs[0] : NULL;

Sure, this is correct, thanks.
-- 
FFmpeg = Funny Fostering Mournful Puristic Enhancing Gymnast


More information about the ffmpeg-devel mailing list