mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-06-16 04:32:47 +02:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user