From 8aa143eaa89cff7a72e2e9c80eb7fbac3b77e5be Mon Sep 17 00:00:00 2001 From: Limin Wang Date: Wed, 20 Nov 2019 23:24:22 +0800 Subject: [PATCH] avfilter/vf_libvmaf: Check for av_frame_alloc failure Reviewed-by: Paul B Mahol Signed-off-by: Limin Wang Signed-off-by: Michael Niedermayer --- libavfilter/vf_libvmaf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c index ed3a383709..14c3216b3a 100644 --- a/libavfilter/vf_libvmaf.c +++ b/libavfilter/vf_libvmaf.c @@ -235,6 +235,9 @@ static av_cold int init(AVFilterContext *ctx) s->gref = av_frame_alloc(); s->gmain = av_frame_alloc(); + if (!s->gref || !s->gmain) + return AVERROR(ENOMEM); + s->error = 0; s->vmaf_thread_created = 0;