diff mbox

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

Message ID 20170330204540.1264-1-michael@niedermayer.cc
State Accepted
Commit 55d53cb59380bebea79ae8f99d4e119b2b006629
Headers show

Commit Message

Michael Niedermayer March 30, 2017, 8:45 p.m. UTC
Fixes: CID1396538

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

Comments

Paul B Mahol March 31, 2017, 8:08 a.m. UTC | #1
On 3/30/17, Michael Niedermayer <michael@niedermayer.cc> wrote:
> Fixes: CID1396538
>
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavfilter/avfiltergraph.c | 3 +++
>  1 file changed, 3 insertions(+)
>

lgtm
diff mbox

Patch

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;