avcodec/wavpack: check for allocation failure
authorPaul B Mahol <onemda@gmail.com>
Wed, 11 Mar 2020 20:53:27 +0000 (21:53 +0100)
committerPaul B Mahol <onemda@gmail.com>
Wed, 11 Mar 2020 20:54:27 +0000 (21:54 +0100)
libavcodec/wavpack.c

index 0326f15..b27262b 100644 (file)
@@ -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;
 }