[FFmpeg-cvslog] avcodec/avrndec: Check allocation for success
Andreas Rheinhardt
git at videolan.org
Tue Sep 15 20:43:40 EEST 2020
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Sun Sep 13 21:57:50 2020 +0200| [d8e4d26de6a96ffd7813aad5bb0680b494192031] | committer: Andreas Rheinhardt
avcodec/avrndec: Check allocation for success
Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d8e4d26de6a96ffd7813aad5bb0680b494192031
---
libavcodec/avrndec.c | 2 ++
1 file changed, 2 insertions(+)
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;
More information about the ffmpeg-cvslog
mailing list