Add missing check in link_filter_inouts(), and fix possible (yet very unlikely) crash.
authorStefano Sabatini <stefano.sabatini-lala@poste.it>
Sun, 7 Nov 2010 18:40:04 +0000 (18:40 +0000)
committerStefano Sabatini <stefano.sabatini-lala@poste.it>
Sun, 7 Nov 2010 18:40:04 +0000 (18:40 +0000)
Originally committed as revision 25695 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavfilter/graphparser.c

index 538d0a6..94e33fa 100644 (file)
@@ -229,6 +229,8 @@ static int link_filter_inouts(AVFilterContext *filt_ctx,
     pad = filt_ctx->output_count;
     while (pad--) {
         AVFilterInOut *currlinkn = av_mallocz(sizeof(AVFilterInOut));
+        if (!currlinkn)
+            return AVERROR(ENOMEM);
         currlinkn->filter  = filt_ctx;
         currlinkn->pad_idx = pad;
         insert_inout(curr_inputs, currlinkn);