[FFmpeg-devel] [PATCH] avfilter/avfiltergraph: Check for allocation failure in avfilter_graph_queue_command()

Michael Niedermayer michael at niedermayer.cc
Thu Mar 30 23:45:40 EEST 2017


Fixes: CID1396538

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavfilter/avfiltergraph.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index 75bd516896..f7fbf119eb 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -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;
-- 
2.11.0



More information about the ffmpeg-devel mailing list