aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-09-13 21:57:50 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-09-15 19:25:25 +0200
commitd8e4d26de6a96ffd7813aad5bb0680b494192031 (patch)
tree3904644248289d5029ef56f17014c76bc97f036d
parentb0a29d88c83facec70f2a0a8941733f88ddde416 (diff)
downloadffmpeg-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.c2
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;