Browse code

avfilter/avfiltergraph: Check for allocation failure in avfilter_graph_queue_command()

Fixes: CID1396538

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

Michael Niedermayer authored on 2017/03/31 05:45:40
Showing 1 changed files
... ...
@@ -1324,6 +1324,9 @@ int avfilter_graph_queue_command(AVFilterGraph *graph, const char *target, const
1324 1324
                 queue = &(*queue)->next;
1325 1325
             next = *queue;
1326 1326
             *queue = av_mallocz(sizeof(AVFilterCommand));
1327
+            if (!*queue)
1328
+                return AVERROR(ENOMEM);
1329
+
1327 1330
             (*queue)->command = av_strdup(command);
1328 1331
             (*queue)->arg     = av_strdup(arg);
1329 1332
             (*queue)->time    = ts;