]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/avrndec: Check allocation for success
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sun, 13 Sep 2020 19:57:50 +0000 (21:57 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 15 Sep 2020 17:25:25 +0000 (19:25 +0200)
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/avrndec.c

index f4ec490de5e3107ec0c5224fca9f4af09ee39fae..a4b6fadfc84efb1f3aa5350cfc9a2418509d63f1 100644 (file)
@@ -54,6 +54,8 @@ static av_cold int init(AVCodecContext *avctx)
         }
 
         a->mjpeg_avctx = avcodec_alloc_context3(codec);
+        if (!a->mjpeg_avctx)
+            return AVERROR(ENOMEM);
 
         av_dict_set(&thread_opt, "threads", "1", 0); // Is this needed ?
         a->mjpeg_avctx->refcounted_frames = 1;