From patchwork Wed Feb 8 23:28:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 2458 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp53581vsb; Wed, 8 Feb 2017 15:29:11 -0800 (PST) X-Received: by 10.28.147.72 with SMTP id v69mr402739wmd.51.1486596551487; Wed, 08 Feb 2017 15:29:11 -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 c27si10782882wra.304.2017.02.08.15.29.10; Wed, 08 Feb 2017 15:29:11 -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 513F9689CD1; Thu, 9 Feb 2017 01:29:05 +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 2680A689B71 for ; Thu, 9 Feb 2017 01:28:59 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 65D35102CF1; Thu, 9 Feb 2017 00:29:02 +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 eTmEbDcsyuBS; Thu, 9 Feb 2017 00:29:01 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 2318A102CA0; Thu, 9 Feb 2017 00:29:01 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Thu, 9 Feb 2017 00:28:53 +0100 Message-Id: <20170208232853.16472-1-cus@passwd.hu> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170208232325.15839-3-cus@passwd.hu> References: <20170208232325.15839-3-cus@passwd.hu> Subject: [FFmpeg-devel] [PATCHv2 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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libavfilter/f_sendcmd.c b/libavfilter/f_sendcmd.c index fb30220..522d6ad 100644 --- a/libavfilter/f_sendcmd.c +++ b/libavfilter/f_sendcmd.c @@ -268,6 +268,13 @@ static int parse_interval(Interval *interval, int interval_count, char *start, *end; start = av_strtok(intervalstr, "-", &end); + if (!start) { + ret = AVERROR(EINVAL); + 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",