diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-09-13 21:57:50 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-09-15 19:25:25 +0200 |
commit | d8e4d26de6a96ffd7813aad5bb0680b494192031 (patch) | |
tree | 3904644248289d5029ef56f17014c76bc97f036d | |
parent | b0a29d88c83facec70f2a0a8941733f88ddde416 (diff) | |
download | ffmpeg-d8e4d26de6a96ffd7813aad5bb0680b494192031.tar.gz |
avcodec/avrndec: Check allocation for success
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r-- | libavcodec/avrndec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/avrndec.c b/libavcodec/avrndec.c index f4ec490de5..a4b6fadfc8 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; |