From patchwork Sun Feb 5 01:27:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 2425 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp1250480vsb; Sat, 4 Feb 2017 17:27:40 -0800 (PST) X-Received: by 10.28.34.194 with SMTP id i185mr3250905wmi.118.1486258060845; Sat, 04 Feb 2017 17:27:40 -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 72si2937732wmr.49.2017.02.04.17.27.40; Sat, 04 Feb 2017 17:27:40 -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 84FA8689941; Sun, 5 Feb 2017 03:27:35 +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 EE2256807EB for ; Sun, 5 Feb 2017 03:27:28 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id B5F5B100B49; Sun, 5 Feb 2017 02:27:30 +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 H046OIWv08qZ; Sun, 5 Feb 2017 02:27:29 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 07B4A100B56; Sun, 5 Feb 2017 02:27:29 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Sun, 5 Feb 2017 02:27:20 +0100 Message-Id: <20170205012720.16257-1-cus@passwd.hu> X-Mailer: git-send-email 2.10.2 Subject: [FFmpeg-devel] [PATCH] avfilter/af_pan: fix null pointer dereference on empty token 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 1396254. Signed-off-by: Marton Balint --- libavfilter/af_pan.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavfilter/af_pan.c b/libavfilter/af_pan.c index 94f1587..00eef2b 100644 --- a/libavfilter/af_pan.c +++ b/libavfilter/af_pan.c @@ -115,6 +115,11 @@ static av_cold int init(AVFilterContext *ctx) if (!args) return AVERROR(ENOMEM); arg = av_strtok(args, "|", &tokenizer); + if (!arg) { + av_log(ctx, AV_LOG_ERROR, "Cannot tokenize argument\n"); + ret = AVERROR(EINVAL); + goto fail; + } ret = ff_parse_channel_layout(&pan->out_channel_layout, &pan->nb_output_channels, arg, ctx); if (ret < 0)