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 <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2026-01-30 17:34:13 +01:00
parent 0c7424e817
commit 31173f148c
+3 -1
View File
@@ -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: