From patchwork Mon Nov 20 09:14:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Zhong Li X-Patchwork-Id: 6221 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.94 with SMTP id m30csp3658260jah; Mon, 20 Nov 2017 01:15:52 -0800 (PST) X-Google-Smtp-Source: AGs4zMZLWYkcFnkb9RfGY4VEhVLpM2CobhxcL2ayxLgPF5SESE/2f+klHwXGPdbTivxauAIbQo6t X-Received: by 10.28.216.196 with SMTP id p187mr4131223wmg.158.1511169352748; Mon, 20 Nov 2017 01:15:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511169352; cv=none; d=google.com; s=arc-20160816; b=UVFd/RCZ+uyWmrw+uqsgzu6rlnaBHiEzpaojMeWI4cRBTQZSAXHE4oK4T5sS+mwVmG oU93cjZnc3ZqkriazrcmMsY4/zJ3odGJntoEdiyl7dYpwjcZoIzEFkEQAgDgmjCrAHF4 3HgKK189tCubv0c+laqgDz0w2FhssimpB1JQFycUTko0wsUnFNHJm1yv5ttnj2AScR7G wI3gieIjNuTdqZ8lfXWiN+SggG8tIqrlYJD0ZOxmZKB3fH4rdYDLy8foR/McFcDsQFLw nhwSSNeI9Ox/MENX3qsTFeo1Sipajhw/rF+skW10m+pfYhgN8ohMk8rzMIgf6870aqgn Kwnw== 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=GGCl8WLBsqCXE9JU/czTNBpynR0AFaEqlV360L55M2o=; b=yKCoqTYWaduwAX+wshP0xPezgGULqkJHiy0oNR14i/XZnsoMlOKFeTCvPnciwqK2/G rnACS3hs1gg/iNEkGTSOkbvb0DMAJa4rOmsAbivbbgQkozwyINNI3+81U7Rf0VDZfuo1 Iklu+BEpXuALhMkzTJoFON6qjvRXjWuALCu26EMNxEjOeAteQDUiolC7OGZj5iWCl7L9 s5gDdTk03uJ+tgfoqQkcKXzZShuZs0Jlrs4uKJMvEZolhLEydzQv4VzhgkWYBD88r3RO FVLoWIPTnJ/ZnFhMddcV2FkvZXrvnQWrMYjeoAOQh4tsndru8vb9dYP6aX2gWbS44kt5 HrjQ== 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 o9si6891785wro.547.2017.11.20.01.15.52; Mon, 20 Nov 2017 01:15:52 -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 2F736689DB9; Mon, 20 Nov 2017 11:15:32 +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 7AE96689CE8 for ; Mon, 20 Nov 2017 11:15:25 +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:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,426,1505804400"; d="scan'208";a="175660484" 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:33 -0800 From: Zhong Li To: ffmpeg-devel@ffmpeg.org Date: Mon, 20 Nov 2017 04:14:33 -0500 Message-Id: <1511169274-28005-2-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 2/3] lavf/qsv_overlay: 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_overlay_qsv.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_overlay_qsv.c b/libavfilter/vf_overlay_qsv.c index 1f50d4b..6c3efdb 100644 --- a/libavfilter/vf_overlay_qsv.c +++ b/libavfilter/vf_overlay_qsv.c @@ -415,6 +415,7 @@ static void overlay_qsv_uninit(AVFilterContext *ctx) static int overlay_qsv_query_formats(AVFilterContext *ctx) { int i; + int ret; static const enum AVPixelFormat main_in_fmts[] = { AV_PIX_FMT_YUV420P, @@ -430,10 +431,15 @@ static int overlay_qsv_query_formats(AVFilterContext *ctx) AV_PIX_FMT_NONE }; - for (i = 0; i < ctx->nb_inputs; i++) - ff_formats_ref(ff_make_format_list(main_in_fmts), &ctx->inputs[i]->out_formats); + for (i = 0; i < ctx->nb_inputs; i++) { + ret = ff_formats_ref(ff_make_format_list(main_in_fmts), &ctx->inputs[i]->out_formats); + if (ret < 0) + return ret; + } - ff_formats_ref(ff_make_format_list(out_pix_fmts), &ctx->outputs[0]->in_formats); + ret = ff_formats_ref(ff_make_format_list(out_pix_fmts), &ctx->outputs[0]->in_formats); + if (ret < 0) + return ret; return 0; }