[FFmpeg-cvslog] avcodec/wavpack: check for allocation failure

Paul B Mahol git at videolan.org
Wed Mar 11 22:58:50 EET 2020


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Wed Mar 11 21:53:27 2020 +0100| [b3c46e26aa283bf8e95451f1d4b1810a6f4e1ade] | committer: Paul B Mahol

avcodec/wavpack: check for allocation failure

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

 libavcodec/wavpack.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 0326f15cd6..b27262b94e 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -987,6 +987,9 @@ static int init_thread_copy(AVCodecContext *avctx)
     s->curr_frame.f = av_frame_alloc();
     s->prev_frame.f = av_frame_alloc();
 
+    if (!s->curr_frame.f || !s->prev_frame.f)
+        return AVERROR(ENOMEM);
+
     return 0;
 }
 



More information about the ffmpeg-cvslog mailing list