From patchwork Thu Mar 30 20:45:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 3202 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.44.195 with SMTP id s186csp1733931vss; Thu, 30 Mar 2017 13:45:52 -0700 (PDT) X-Received: by 10.28.15.69 with SMTP id 66mr92636wmp.105.1490906752846; Thu, 30 Mar 2017 13:45:52 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id x64si290163wmb.162.2017.03.30.13.45.52; Thu, 30 Mar 2017 13:45:52 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B3875689761; Thu, 30 Mar 2017 23:45:49 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe01-3.mx.upcmail.net (vie01a-dmta-pe01-3.mx.upcmail.net [62.179.121.156]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 225226883E3 for ; Thu, 30 Mar 2017 23:45:43 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe01.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1ctgww-0008Ei-Ux for ffmpeg-devel@ffmpeg.org; Thu, 30 Mar 2017 22:45:42 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id 2Llg1v01j0S5wYM01Llh6Q; Thu, 30 Mar 2017 22:45:41 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 30 Mar 2017 22:45:40 +0200 Message-Id: <20170330204540.1264-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.11.0 Subject: [FFmpeg-devel] [PATCH] avfilter/avfiltergraph: Check for allocation failure in avfilter_graph_queue_command() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixes: CID1396538 Signed-off-by: Michael Niedermayer --- 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;