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>2021-02-27 07:20:57 +0100
commit682574e1da9bd87b32d5d46143fe2b434f742259 (patch)
tree66c905aba374329f36fb00e8f3eea650d8617564
parent634c4ce8b08a5f7eaf1a31be42bbfd6b59ff4bf0 (diff)
downloadffmpeg-682574e1da9bd87b32d5d46143fe2b434f742259.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> (cherry picked from commit d8e4d26de6a96ffd7813aad5bb0680b494192031)
-rw-r--r--libavcodec/avrndec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/avrndec.c b/libavcodec/avrndec.c
index 104ff2d904..d10c4395e3 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;