[FFmpeg-cvslog] avfilter/vf_libvmaf: Check for av_frame_alloc failure

Limin Wang git at videolan.org
Thu Nov 28 19:50:52 EET 2019


ffmpeg | branch: master | Limin Wang <lance.lmwang at gmail.com> | Wed Nov 20 23:24:22 2019 +0800| [8aa143eaa89cff7a72e2e9c80eb7fbac3b77e5be] | committer: Michael Niedermayer

avfilter/vf_libvmaf: Check for av_frame_alloc failure

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8aa143eaa89cff7a72e2e9c80eb7fbac3b77e5be
---

 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;



More information about the ffmpeg-cvslog mailing list