From patchwork Wed Feb 8 23:23:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 2454 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp51934vsb; Wed, 8 Feb 2017 15:23:55 -0800 (PST) X-Received: by 10.28.232.196 with SMTP id f65mr371759wmi.19.1486596235014; Wed, 08 Feb 2017 15:23:55 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id q107si10780192wrb.276.2017.02.08.15.23.54; Wed, 08 Feb 2017 15:23:54 -0800 (PST) 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 D7F39689CD7; Thu, 9 Feb 2017 01:23:36 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D0CD8689C85 for ; Thu, 9 Feb 2017 01:23:30 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 26898102CF1; Thu, 9 Feb 2017 00:23:34 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id v5bG5pAN-O9B; Thu, 9 Feb 2017 00:23:33 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id E142A102CF9; Thu, 9 Feb 2017 00:23:32 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Thu, 9 Feb 2017 00:23:25 +0100 Message-Id: <20170208232325.15839-3-cus@passwd.hu> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170208232325.15839-1-cus@passwd.hu> References: <20170208232325.15839-1-cus@passwd.hu> Subject: [FFmpeg-devel] [PATCH 3/3] avfilter/f_setcmd: fix null pointer dereference on using dash as interval 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 Cc: Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixes Coverity CID 1396259. Signed-off-by: Marton Balint --- libavfilter/f_sendcmd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavfilter/f_sendcmd.c b/libavfilter/f_sendcmd.c index fb30220..ce21369 100644 --- a/libavfilter/f_sendcmd.c +++ b/libavfilter/f_sendcmd.c @@ -268,6 +268,12 @@ static int parse_interval(Interval *interval, int interval_count, char *start, *end; start = av_strtok(intervalstr, "-", &end); + if (!start) { + av_log(log_ctx, AV_LOG_ERROR, + "Invalid interval specification '%s' in interval #%d\n", + intervalstr, interval_count); + goto end; + } if ((ret = av_parse_time(&interval->start_ts, start, 1)) < 0) { av_log(log_ctx, AV_LOG_ERROR, "Invalid start time specification '%s' in interval #%d\n",