From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id C7257432A4 for ; Mon, 27 Jun 2022 10:18:36 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C385268B7D5; Mon, 27 Jun 2022 13:18:33 +0300 (EEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2DF8B68B6D3 for ; Mon, 27 Jun 2022 13:18:25 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656325111; x=1687861111; h=from:to:subject:date:message-id; bh=UfyI3yIBIAGI0LBDrBEcz7R25Eqx1Z7m9hjB7UUPwq0=; b=Qe6qC5WYBISFpNMIVggQMAYf640xfDJVxzpWAxS+oBTIjTexHZx12XJG eSy8YyjWz5Sq5Q0LNDlGK+MWam6pJ4MfTOSmJk7c7gqel89B2oU7o4g3e 5qkX6iDxQFlfoqQTtMdCk2WvpI+OEE6jijNA2GXGRD1BlcMZ2+uRIAaHR PAzxaiI+AOXVZykmwzRPV9oTqhjn+JYLClVWDDRofNYnLPOrgxGJT+pGV o6cT1Ps1BIJzxjxMGfrQFvjcJOCi6LpP48jf9qiXB6thMCGJx++VyWzNV rrPoKkEspwvZoKmTHS1VcwgIHIpIh89nvB6UaCnSPQTR0yfqOmyMxMaJp w==; X-IronPort-AV: E=McAfee;i="6400,9594,10390"; a="270160607" X-IronPort-AV: E=Sophos;i="5.92,226,1650956400"; d="scan'208";a="270160607" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2022 03:18:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,226,1650956400"; d="scan'208";a="587390380" Received: from semmer-ubuntu.sh.intel.com ([10.239.159.83]) by orsmga007.jf.intel.com with ESMTP; 27 Jun 2022 03:18:22 -0700 From: Ting Fu To: ffmpeg-devel@ffmpeg.org Date: Mon, 27 Jun 2022 18:02:30 +0800 Message-Id: <20220627100230.31863-1-ting.fu@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH] lavf/sr: fix the segmentation fault caused by incorrect input frame free. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: This issue would cause segmetaion fault when running srcnn model with sr filter by TensorFlow backend. This filter would free the frame incorectly. Signed-off-by: Ting Fu --- libavfilter/vf_sr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_sr.c b/libavfilter/vf_sr.c index 0890c8ba18..cb24c096ce 100644 --- a/libavfilter/vf_sr.c +++ b/libavfilter/vf_sr.c @@ -159,8 +159,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) sws_scale(ctx->sws_uv_scale, (const uint8_t **)(in->data + 2), in->linesize + 2, 0, ctx->sws_uv_height, out->data + 2, out->linesize + 2); } - - av_frame_free(&in); + if (in != out) { + av_frame_free(&in); + } return ff_filter_frame(outlink, out); } -- 2.17.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".