]> git.sesse.net Git - ffmpeg/commitdiff
lavfi: fix null checking in avfilter_config_links()
authorXi Wang <xi.wang@gmail.com>
Sun, 20 Jan 2013 20:38:21 +0000 (15:38 -0500)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 20 Jan 2013 23:07:00 +0000 (00:07 +0100)
Move the first use of `link' after the null pointer check.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/avfilter.c

index 8c06173c8318fed4338a3c1230a1136f3a8cd223..4759d13c5f10b0208c76bcc0ac22d9615e92b0f2 100644 (file)
@@ -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;
         link->current_pts = AV_NOPTS_VALUE;
 
         switch (link->init_state) {