From 8df5fbf0b0c0ba12b033e61c28fc240f4bccba47 Mon Sep 17 00:00:00 2001
From: Vittorio Giovara <vittorio.giovara@gmail.com>
Date: Sun, 31 May 2015 14:54:21 +0200
Subject: [PATCH] lcl: Check memory allocation

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

diff --git a/libavcodec/lclenc.c b/libavcodec/lclenc.c
index 20841bcf584..2448b9ef91e 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)
-- 
GitLab