From: Andreas Rheinhardt Date: Sun, 13 Sep 2020 19:57:50 +0000 (+0200) Subject: avcodec/avrndec: Check allocation for success X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=d8e4d26de6a96ffd7813aad5bb0680b494192031;p=ffmpeg avcodec/avrndec: Check allocation for success Reviewed-by: Paul B Mahol Signed-off-by: Andreas Rheinhardt --- diff --git a/libavcodec/avrndec.c b/libavcodec/avrndec.c index f4ec490de5e..a4b6fadfc84 100644 --- a/libavcodec/avrndec.c +++ b/libavcodec/avrndec.c @@ -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;