[FFmpeg-cvslog] lcl: Check memory allocation

Vittorio Giovara git at videolan.org
Mon Jun 1 02:08:01 CEST 2015


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Sun May 31 14:54:21 2015 +0200| [8df5fbf0b0c0ba12b033e61c28fc240f4bccba47] | committer: Luca Barbato

lcl: Check memory allocation

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8df5fbf0b0c0ba12b033e61c28fc240f4bccba47
---

 libavcodec/lclenc.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/lclenc.c b/libavcodec/lclenc.c
index 20841bc..2448b9e 100644
--- a/libavcodec/lclenc.c
+++ b/libavcodec/lclenc.c
@@ -135,6 +135,8 @@ static av_cold int encode_init(AVCodecContext *avctx)
     assert(avctx->width && avctx->height);
 
     avctx->extradata= av_mallocz(8);
+    if (!avctx->extradata)
+        return AVERROR(ENOMEM);
 
     avctx->coded_frame = av_frame_alloc();
     if (!avctx->coded_frame)



More information about the ffmpeg-cvslog mailing list