From patchwork Wed Jan 25 00:57:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 2304 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp1986141vsb; Tue, 24 Jan 2017 16:57:40 -0800 (PST) X-Received: by 10.223.150.34 with SMTP id b31mr31336940wra.196.1485305860544; Tue, 24 Jan 2017 16:57: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 d3si24764589wrb.106.2017.01.24.16.57.39; Tue, 24 Jan 2017 16:57: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 C571C68A56C; Wed, 25 Jan 2017 02:57: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 807B468A54D for ; Wed, 25 Jan 2017 02:57:30 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id A336D102DDD; Wed, 25 Jan 2017 01:57: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 pn1GgoPyTZ2M; Wed, 25 Jan 2017 01:57:29 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 5BD25100BDA; Wed, 25 Jan 2017 01:57:29 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 Jan 2017 01:57:24 +0100 Message-Id: <20170125005725.16675-1-cus@passwd.hu> X-Mailer: git-send-email 2.10.2 Subject: [FFmpeg-devel] [PATCH 1/2] avfilter/ebur128: do not allow null ebur128 context in ff_ebur128_relative_threshold 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: k@ylo.ph, Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The user should supply a proper context. Fixes Coverity CID 1396246. Signed-off-by: Marton Balint --- libavfilter/ebur128.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/ebur128.c b/libavfilter/ebur128.c index a46692e..012df54 100644 --- a/libavfilter/ebur128.c +++ b/libavfilter/ebur128.c @@ -599,7 +599,7 @@ int ff_ebur128_relative_threshold(FFEBUR128State * st, double *out) double relative_threshold; size_t above_thresh_counter; - if (st && (st->mode & FF_EBUR128_MODE_I) != FF_EBUR128_MODE_I) + if ((st->mode & FF_EBUR128_MODE_I) != FF_EBUR128_MODE_I) return AVERROR(EINVAL); ebur128_calc_relative_threshold(st, &above_thresh_counter,