From 31173f148ced362edb01c7c885e73def279d0497 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Fri, 30 Jan 2026 17:34:13 +0100 Subject: [PATCH] avfilter/vf_removelogo: Properly handle allocation error Don't rely on av_image_copy_plane() handling a NULL dst gracefully. Signed-off-by: Andreas Rheinhardt --- libavfilter/vf_removelogo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_removelogo.c b/libavfilter/vf_removelogo.c index 70e4eef0a0..87cbc09233 100644 --- a/libavfilter/vf_removelogo.c +++ b/libavfilter/vf_removelogo.c @@ -223,8 +223,10 @@ static int load_mask(uint8_t **mask, int *w, int *h, /* copy mask to a newly allocated array */ *mask = av_malloc(*w * *h); - if (!*mask) + if (!*mask) { ret = AVERROR(ENOMEM); + goto end; + } av_image_copy_plane(*mask, *w, gray_data[0], gray_linesize[0], *w, *h); end: