libavcodec/alacenc.c:391: error: Null Dereference
  pointer `alac_extradata` last assigned on line 364 could be null and is dereferenced at line 391, column 5.

libavcodec/alacenc.c:361:1: start of procedure alac_encode_init()
359. }
360. 
361. static av_cold int alac_encode_init(AVCodecContext *avctx)
     ^
362. {
363.     AlacEncodeContext *s    = avctx->priv_data;

libavcodec/alacenc.c:363:5: 
361. static av_cold int alac_encode_init(AVCodecContext *avctx)
362. {
363.     AlacEncodeContext *s    = avctx->priv_data;
         ^
364.     uint8_t *alac_extradata = av_mallocz(ALAC_EXTRADATA_SIZE+1);
365. 

libavcodec/alacenc.c:364:5: 
362. {
363.     AlacEncodeContext *s    = avctx->priv_data;
364.     uint8_t *alac_extradata = av_mallocz(ALAC_EXTRADATA_SIZE+1);
         ^
365. 
366.     avctx->frame_size      = DEFAULT_FRAME_SIZE;

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/alacenc.c:366:5: 
364.     uint8_t *alac_extradata = av_mallocz(ALAC_EXTRADATA_SIZE+1);
365. 
366.     avctx->frame_size      = DEFAULT_FRAME_SIZE;
         ^
367.     avctx->bits_per_coded_sample = DEFAULT_SAMPLE_SIZE;
368. 

libavcodec/alacenc.c:367:5: 
365. 
366.     avctx->frame_size      = DEFAULT_FRAME_SIZE;
367.     avctx->bits_per_coded_sample = DEFAULT_SAMPLE_SIZE;
         ^
368. 
369.     if(avctx->sample_fmt != SAMPLE_FMT_S16) {

libavcodec/alacenc.c:369:8: Taking false branch
367.     avctx->bits_per_coded_sample = DEFAULT_SAMPLE_SIZE;
368. 
369.     if(avctx->sample_fmt != SAMPLE_FMT_S16) {
            ^
370.         av_log(avctx, AV_LOG_ERROR, "only pcm_s16 input samples are supported\n");
371.         return -1;

libavcodec/alacenc.c:375:8: Taking false branch
373. 
374.     // Set default compression level
375.     if(avctx->compression_level == FF_COMPRESSION_DEFAULT)
            ^
376.         s->compression_level = 1;
377.     else

libavcodec/alacenc.c:378:9: 
376.         s->compression_level = 1;
377.     else
378.         s->compression_level = av_clip(avctx->compression_level, 0, 1);
             ^
379. 
380.     // Initialize default Rice parameters

libavutil/common.h:199:1: start of procedure av_clip()
  197.  * @return clipped value
  198.  */
  199. static inline av_const int av_clip(int a, int amin, int amax)
       ^
  200. {
  201.     if      (a < amin) return amin;

libavutil/common.h:201:14: Taking false branch
  199. static inline av_const int av_clip(int a, int amin, int amax)
  200. {
  201.     if      (a < amin) return amin;
                    ^
  202.     else if (a > amax) return amax;
  203.     else               return a;

libavutil/common.h:202:14: Taking false branch
  200. {
  201.     if      (a < amin) return amin;
  202.     else if (a > amax) return amax;
                    ^
  203.     else               return a;
  204. }

libavutil/common.h:203:24: 
  201.     if      (a < amin) return amin;
  202.     else if (a > amax) return amax;
  203.     else               return a;
                              ^
  204. }
  205. 

libavutil/common.h:204:1: return from a call to av_clip
  202.     else if (a > amax) return amax;
  203.     else               return a;
  204. }
       ^
  205. 
  206. /**

libavcodec/alacenc.c:381:5: 
379. 
380.     // Initialize default Rice parameters
381.     s->rc.history_mult    = 40;
         ^
382.     s->rc.initial_history = 10;
383.     s->rc.k_modifier      = 14;

libavcodec/alacenc.c:382:5: 
380.     // Initialize default Rice parameters
381.     s->rc.history_mult    = 40;
382.     s->rc.initial_history = 10;
         ^
383.     s->rc.k_modifier      = 14;
384.     s->rc.rice_modifier   = 4;

libavcodec/alacenc.c:383:5: 
381.     s->rc.history_mult    = 40;
382.     s->rc.initial_history = 10;
383.     s->rc.k_modifier      = 14;
         ^
384.     s->rc.rice_modifier   = 4;
385. 

libavcodec/alacenc.c:384:5: 
382.     s->rc.initial_history = 10;
383.     s->rc.k_modifier      = 14;
384.     s->rc.rice_modifier   = 4;
         ^
385. 
386.     s->max_coded_frame_size = (ALAC_FRAME_HEADER_SIZE + ALAC_FRAME_FOOTER_SIZE +

libavcodec/alacenc.c:386:5: 
384.     s->rc.rice_modifier   = 4;
385. 
386.     s->max_coded_frame_size = (ALAC_FRAME_HEADER_SIZE + ALAC_FRAME_FOOTER_SIZE +
         ^
387.                                avctx->frame_size*avctx->channels*avctx->bits_per_coded_sample)>>3;
388. 

libavcodec/alacenc.c:389:5: 
387.                                avctx->frame_size*avctx->channels*avctx->bits_per_coded_sample)>>3;
388. 
389.     s->write_sample_size  = avctx->bits_per_coded_sample + avctx->channels - 1; // FIXME: consider wasted_bytes
         ^
390. 
391.     AV_WB32(alac_extradata,    ALAC_EXTRADATA_SIZE);

libavcodec/alacenc.c:391:5: 
389.     s->write_sample_size  = avctx->bits_per_coded_sample + avctx->channels - 1; // FIXME: consider wasted_bytes
390. 
391.     AV_WB32(alac_extradata,    ALAC_EXTRADATA_SIZE);
         ^
392.     AV_WB32(alac_extradata+4,  MKBETAG('a','l','a','c'));
393.     AV_WB32(alac_extradata+12, avctx->frame_size);
