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 7050740FD1 for ; Sun, 2 Jan 2022 14:52:48 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A6C3E68B176; Sun, 2 Jan 2022 16:52:18 +0200 (EET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 37DBD68B16F for ; Sun, 2 Jan 2022 16:52:11 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1641135136; x=1672671136; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tWZJ7PgKT3cYAbas2CjemCgv5HqU94xSL1MoB+/ksqk=; b=JCbbaP+VS5MkRnGXkxRhjQ7/wOIzPNBa9omzZ4BjsV1ogXtLnF67diMw 6zbt8xrRMvHluA9vmb854ZlsA2HcQ0BO36oJUkKndabh+IoeSddkAmPrD wEplFyVUJtXXR031Ug6yuMI2DfJkyZU09jbDIzufw7sSccf2Vg+jYGPXC jWd9pSuQW1FLp8otRU/8BYE5e+oXDW18+30vtC/weJgFD7if2se+iDZyK TMHVBLGVHwxO2fzwVMJB7gMKqyQxWf3qKPDby9034IF5tU8p8jySyJqHq crgpMYUbMaEdinHta0rUBPByrCVgu63GUTWmK/LAppnFAmuPL/ubbdB4Q Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10214"; a="221966003" X-IronPort-AV: E=Sophos;i="5.88,256,1635231600"; d="scan'208";a="221966003" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jan 2022 06:52:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,256,1635231600"; d="scan'208";a="667176325" Received: from chenwenbin-z390-aorus-ultra.sh.intel.com ([10.239.35.110]) by fmsmga001.fm.intel.com with ESMTP; 02 Jan 2022 06:52:05 -0800 From: Wu Jianhua To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Jan 2022 22:51:42 +0800 Message-Id: <20220102145142.4083918-5-jianhua.wu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220102145142.4083918-1-jianhua.wu@intel.com> References: <20220102145142.4083918-1-jianhua.wu@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/5] avfilter/vf_blend: fix un-checked potential memory allocation failure 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 Cc: Wu Jianhua 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: Signed-off-by: Wu Jianhua --- libavfilter/vf_blend.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c index b6f3c4fed3..2d433e439f 100644 --- a/libavfilter/vf_blend.c +++ b/libavfilter/vf_blend.c @@ -279,7 +279,11 @@ static AVFrame *blend_frame(AVFilterContext *ctx, AVFrame *top_buf, dst_buf = ff_get_video_buffer(outlink, outlink->w, outlink->h); if (!dst_buf) return top_buf; - av_frame_copy_props(dst_buf, top_buf); + + if (av_frame_copy_props(dst_buf, top_buf) < 0) { + av_frame_free(&dst_buf); + return top_buf; + } for (plane = 0; plane < s->nb_planes; plane++) { int hsub = plane == 1 || plane == 2 ? s->hsub : 0; -- 2.25.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".