From patchwork Mon Nov 20 09:14:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Zhong Li X-Patchwork-Id: 6222 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.94 with SMTP id m30csp3658356jah; Mon, 20 Nov 2017 01:16:01 -0800 (PST) X-Google-Smtp-Source: AGs4zMaZPrZW6e1mK6Hirrv3u98hBu5HL4dBTm4VymblQdywuvL2ABIp/MybElbSZAPg9XOCxxg0 X-Received: by 10.223.170.214 with SMTP id i22mr12105747wrc.110.1511169361657; Mon, 20 Nov 2017 01:16:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511169361; cv=none; d=google.com; s=arc-20160816; b=mlN46U4Dg/6BoiZ4CJDa4QuaJFN7jSm92ACymF+Y5S1uYSfigrjTdhuBMcT20lRInN iJJd/BXYpao1FCYiXcKrIViML0M2Ohskd0/E2aHB8FXClNnss8MfGuKH69AhzAcBnNYN RNgy0flvQcHJcX0FxV3TsyidQxWPNE9UJNJxUsnvzLyN/JdXGRV+HqhtxFf/T4/ng1Rs Dbi5bU0wR18FiBr1pj5Xm0qyjUgt9RzdwiMlZiUP8ZRwzxoTxt0UR/k546p2KAo7qsIv ItXatLKLsVGO9a7awYsFULVpPq650p0vUBOl8BemjsxEXpJWF81+oRZI6GB6IKsRFRqs A1uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:delivered-to:arc-authentication-results; bh=YRrOAHPStr7syW26r8azOZ6vzKo9SyKWMtmzEPA5XOw=; b=qdy2Iz0s4nc+V8Ds1J6Ly0ncu2M6Lu9ITY1Oe0W17bFqc3oUy3z+EF9pQLUobBNtMD sk+LAC5do4Z/KlVcQ5aADappy6i9bU6Gy9G6Ugp5i4c485dR/u+fcKUu+m0vRSIbSgBk 0vNzrR1VVGmqAZqcbfnoBOF9Ixxux8EAzqQ4qtFILNdK674elqXaS6IEo3ovK64MgRrF trPrpcjTpJBYzRozwrUMwmAKYpBGL7/Fqz3hrIVbnmahQVpOs/ha7GdMagXoHEGIvWVl cI/TlA9BjHQBcguSgQ7EYNcsef6aR0KZ3O+wI9Lmv3U+jxgBSIz8KCMAijYaD97gKZWq OeHw== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id w142si6674768wmw.195.2017.11.20.01.16.01; Mon, 20 Nov 2017 01:16:01 -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 87C35689DD9; Mon, 20 Nov 2017 11:15:33 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F3B35689CFD for ; Mon, 20 Nov 2017 11:15:26 +0200 (EET) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Nov 2017 01:15:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,426,1505804400"; d="scan'208";a="175660490" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.239.13.100]) by orsmga005.jf.intel.com with ESMTP; 20 Nov 2017 01:15:34 -0800 From: Zhong Li To: ffmpeg-devel@ffmpeg.org Date: Mon, 20 Nov 2017 04:14:34 -0500 Message-Id: <1511169274-28005-3-git-send-email-zhong.li@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1511169274-28005-1-git-send-email-zhong.li@intel.com> References: <1511169274-28005-1-git-send-email-zhong.li@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 3/3] lavf/qsv_vpp: check the return value of ff_formats_ref() 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: Zhong Li Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" suppress the build warning of "ignoring return value of ‘ff_formats_ref’, declared with attribute warn_unused_result" Signed-off-by: Zhong Li Reviewed-by: Carl Eugen Hoyos --- libavfilter/vf_vpp_qsv.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c index eb2f1cc..bd5fc32 100644 --- a/libavfilter/vf_vpp_qsv.c +++ b/libavfilter/vf_vpp_qsv.c @@ -332,6 +332,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref) static int query_formats(AVFilterContext *ctx) { + int ret; AVFilterFormats *in_fmts, *out_fmts; static const enum AVPixelFormat in_pix_fmts[] = { AV_PIX_FMT_YUV420P, @@ -349,8 +350,12 @@ static int query_formats(AVFilterContext *ctx) in_fmts = ff_make_format_list(in_pix_fmts); out_fmts = ff_make_format_list(out_pix_fmts); - ff_formats_ref(in_fmts, &ctx->inputs[0]->out_formats); - ff_formats_ref(out_fmts, &ctx->outputs[0]->in_formats); + ret = ff_formats_ref(in_fmts, &ctx->inputs[0]->out_formats); + if (ret < 0) + return ret; + ret = ff_formats_ref(out_fmts, &ctx->outputs[0]->in_formats); + if (ret < 0) + return ret; return 0; }