avfilter/avfiltergraph: Check for allocation failure in avfilter_graph_queue_command()
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 30 Mar 2017 20:45:40 +0000 (22:45 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 31 Mar 2017 10:28:58 +0000 (12:28 +0200)
Fixes: CID1396538

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavfilter/avfiltergraph.c

index 75bd516..f7fbf11 100644 (file)
@@ -1324,6 +1324,9 @@ int avfilter_graph_queue_command(AVFilterGraph *graph, const char *target, const
                 queue = &(*queue)->next;
             next = *queue;
             *queue = av_mallocz(sizeof(AVFilterCommand));
+            if (!*queue)
+                return AVERROR(ENOMEM);
+
             (*queue)->command = av_strdup(command);
             (*queue)->arg     = av_strdup(arg);
             (*queue)->time    = ts;