aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWu Jianhua <jianhua.wu@intel.com>2022-01-01 03:17:09 +0800
committerLynne <dev@lynne.ee>2022-01-05 15:17:35 +0100
commiteb091d211f34ab668b764c795c4a5e2ac7329224 (patch)
tree4f8660a950c5306401a642dd7eeb35b3ab2213a4
parent85fca9f92bd8ac22b13061b0484b31af253e6f20 (diff)
downloadffmpeg-eb091d211f34ab668b764c795c4a5e2ac7329224.tar.gz
avfilter/vf_blend: fix un-checked potential memory allocation failure
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
-rw-r--r--libavfilter/vf_blend.c6
1 files changed, 5 insertions, 1 deletions
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;