libavcodec/lclenc.c:174: error: Null Dereference
  pointer `avctx->extradata` last assigned on line 156 could be null and is dereferenced at line 174, column 5.

libavcodec/lclenc.c:142:1: start of procedure encode_init()
140.  *
141.  */
142. static av_cold int encode_init(AVCodecContext *avctx)
     ^
143. {
144.     LclEncContext *c = avctx->priv_data;

libavcodec/lclenc.c:144:5: 
142. static av_cold int encode_init(AVCodecContext *avctx)
143. {
144.     LclEncContext *c = avctx->priv_data;
         ^
145.     int zret; // Zlib return code
146. 

libavcodec/lclenc.c:152:5: 
150. #else
151. 
152.     c->avctx= avctx;
         ^
153. 
154.     assert(avctx->width && avctx->height);

libavcodec/lclenc.c:154:5: 
152.     c->avctx= avctx;
153. 
154.     assert(avctx->width && avctx->height);
         ^
155. 
156.     avctx->extradata= av_mallocz(8);

libavcodec/lclenc.c:156:5: 
154.     assert(avctx->width && avctx->height);
155. 
156.     avctx->extradata= av_mallocz(8);
         ^
157.     avctx->coded_frame= &c->pic;
158. 

libavutil/mem.c:132:1: start of procedure av_mallocz()
  130. }
  131. 
  132. void *av_mallocz(unsigned int size)
       ^
  133. {
  134.     void *ptr = av_malloc(size);

libavutil/mem.c:134:5: 
  132. void *av_mallocz(unsigned int size)
  133. {
  134.     void *ptr = av_malloc(size);
           ^
  135.     if (ptr)
  136.         memset(ptr, 0, size);

libavutil/mem.c:42:1: start of procedure av_malloc()
    40.    linker will do it automatically */
    41. 
    42. void *av_malloc(unsigned int size)
        ^
    43. {
    44.     void *ptr;

libavutil/mem.c:50:8: Taking false branch
    48. 
    49.     /* let's disallow possible ambiguous cases */
    50.     if(size > (INT_MAX-16) )
               ^
    51.         return NULL;
    52. 

libavutil/mem.c:61:5: Skipping memalign(): method has no implementation
    59.     ((char*)ptr)[-1]= diff;
    60. #elif defined (HAVE_MEMALIGN)
    61.     ptr = memalign(16,size);
            ^
    62.     /* Why 64?
    63.        Indeed, we should align it:

libavutil/mem.c:91:5: 
    89.     ptr = malloc(size);
    90. #endif
    91.     return ptr;
            ^
    92. }
    93. 

libavutil/mem.c:92:1: return from a call to av_malloc
    90. #endif
    91.     return ptr;
    92. }
        ^
    93. 
    94. void *av_realloc(void *ptr, unsigned int size)

libavutil/mem.c:135:9: Taking false branch
  133. {
  134.     void *ptr = av_malloc(size);
  135.     if (ptr)
               ^
  136.         memset(ptr, 0, size);
  137.     return ptr;

libavutil/mem.c:137:5: 
  135.     if (ptr)
  136.         memset(ptr, 0, size);
  137.     return ptr;
           ^
  138. }
  139. 

libavutil/mem.c:138:1: return from a call to av_mallocz
  136.         memset(ptr, 0, size);
  137.     return ptr;
  138. }
       ^
  139. 
  140. char *av_strdup(const char *s)

libavcodec/lclenc.c:157:5: 
155. 
156.     avctx->extradata= av_mallocz(8);
157.     avctx->coded_frame= &c->pic;
         ^
158. 
159.     // Will be user settable someday

libavcodec/lclenc.c:160:5: 
158. 
159.     // Will be user settable someday
160.     c->compression = 6;
         ^
161.     c->flags = 0;
162. 

libavcodec/lclenc.c:161:5: 
159.     // Will be user settable someday
160.     c->compression = 6;
161.     c->flags = 0;
         ^
162. 
163.     switch(avctx->pix_fmt){

libavcodec/lclenc.c:163:5: 
161.     c->flags = 0;
162. 
163.     switch(avctx->pix_fmt){
         ^
164.         case PIX_FMT_BGR24:
165.             c->imgtype = IMGTYPE_RGB24;

libavcodec/lclenc.c:164:9: Switch condition is true. Entering switch case
162. 
163.     switch(avctx->pix_fmt){
164.         case PIX_FMT_BGR24:
             ^
165.             c->imgtype = IMGTYPE_RGB24;
166.             c->decomp_size = avctx->width * avctx->height * 3;

libavcodec/lclenc.c:165:13: 
163.     switch(avctx->pix_fmt){
164.         case PIX_FMT_BGR24:
165.             c->imgtype = IMGTYPE_RGB24;
                 ^
166.             c->decomp_size = avctx->width * avctx->height * 3;
167.             avctx->bits_per_sample= 24;

libavcodec/lclenc.c:166:13: 
164.         case PIX_FMT_BGR24:
165.             c->imgtype = IMGTYPE_RGB24;
166.             c->decomp_size = avctx->width * avctx->height * 3;
                 ^
167.             avctx->bits_per_sample= 24;
168.             break;

libavcodec/lclenc.c:167:13: 
165.             c->imgtype = IMGTYPE_RGB24;
166.             c->decomp_size = avctx->width * avctx->height * 3;
167.             avctx->bits_per_sample= 24;
                 ^
168.             break;
169.         default:

libavcodec/lclenc.c:174:5: 
172.     }
173. 
174.     ((uint8_t*)avctx->extradata)[0]= 4;
         ^
175.     ((uint8_t*)avctx->extradata)[1]= 0;
176.     ((uint8_t*)avctx->extradata)[2]= 0;
