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

libavfilter/graphparser.c

index 6c73543..3b49898 100644 (file)
@@ -258,7 +258,8 @@ static int parse_inputs(const char **buf, AVFilterInOut **curr_inputs,
             av_free(name);
         } else {
             /* Not in the list, so add it as an input */
-            match = av_mallocz(sizeof(AVFilterInOut));
+            if (!(match = av_mallocz(sizeof(AVFilterInOut))))
+                return AVERROR(ENOMEM);
             match->name    = name;
             match->pad_idx = pad;
         }