From patchwork Tue Apr 21 13:35:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Steven X-Patchwork-Id: 19137 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 432AD449BA5 for ; Tue, 21 Apr 2020 16:35:38 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 20E1F68B9DE; Tue, 21 Apr 2020 16:35:38 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpbgeu1.qq.com (smtpbgeu1.qq.com [52.59.177.22]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1A81668B691 for ; Tue, 21 Apr 2020 16:35:32 +0300 (EEST) X-QQ-mid: bizesmtp23t1587476114t2wzxu2u Received: from localhost (unknown [221.216.234.168]) by esmtp10.qq.com (ESMTP) with id ; Tue, 21 Apr 2020 21:35:14 +0800 (CST) X-QQ-SSF: 01100000002000K0ZUF0B00A0000000 X-QQ-FEAT: a5Sfq5qTxp27IhiVHhmp2RXO4uXN1DznM0Z/9Z2vPJJWnoMP2k+9fm0pAf+rp njs5BIKuNXUWNtHCvUFocw5YciFO6w8woPiyrfDF459saC+7QQmea0gFnQJhf0Pi+3lLKjn oV0Bc5Z/x/E5ca2q/ipU7/1FdvImD6gGv5/pQ+YMbh9h1qBM1fnR2AxJFVS8Xd/4iczaz+P 9W3pNOBe2RQQeHTkRqy+Aqlx0ZogecTwNX4qHrvX1yvDNEsIIA7S0wFUqk8534NZKeMgMvy XPbE19W2cHwCLhMDmI02uugcewgJ6aUiPdpIB0AJ+l9/CLYlw0WiHYAsQ= X-QQ-GoodBg: 0 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Tue, 21 Apr 2020 21:35:12 +0800 Message-Id: <20200421133512.96122-1-lq@chinaffmpeg.org> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:chinaffmpeg.org:qybgforeign:qybgforeign6 X-QQ-Bgrelay: 1 Subject: [FFmpeg-devel] [PATCH] avfilter/vf_v360: check the limit of in_pad and out_pad 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: Steven Liu Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" When i set out_pad=1 it will Segmentation fault so i think it should check the limit value of the in_pad and out_pad Signed-off-by: Steven Liu --- libavfilter/vf_v360.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c index ebc281dfca..6aabbc11ff 100644 --- a/libavfilter/vf_v360.c +++ b/libavfilter/vf_v360.c @@ -3766,6 +3766,10 @@ static int config_output(AVFilterLink *outlink) int (*prepare_out)(AVFilterContext *ctx); int have_alpha; + if (s->out_pad == 1.0 || s->in_pad == 1.0) { + av_log(s, AV_LOG_ERROR, "pad should smaller than 1.0\n"); + return AVERROR(EINVAL); + } s->max_value = (1 << depth) - 1; s->input_mirror_modifier[0] = s->ih_flip ? -1.f : 1.f; s->input_mirror_modifier[1] = s->iv_flip ? -1.f : 1.f;