avfilter/vf_blend: fix un-checked potential memory allocation failure

Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
This commit is contained in:
Wu Jianhua 2022-01-01 03:17:09 +08:00 committed by Lynne
parent aa8bb05d29
commit 49250b582a
1 changed files with 5 additions and 1 deletions

View File

@ -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;