[FFmpeg-devel] [PATCH v2] avfilter/vf_libvmaf: Check for av_frame_alloc failure

lance.lmwang at gmail.com lance.lmwang at gmail.com
Wed Nov 20 17:24:22 EET 2019


From: Limin Wang <lance.lmwang at gmail.com>

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
---
Add Reviewed-by:, pleae help push it

 libavfilter/vf_libvmaf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c
index ed3a383..14c3216 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;
-- 
2.6.4



More information about the ffmpeg-devel mailing list