libavcodec/pcm.c:124: error: Null Dereference
  pointer `avctx->coded_frame` last assigned on line 123 could be null and is dereferenced at line 124, column 5.

libavcodec/pcm.c:107:1: start of procedure pcm_encode_init()
105. }
106. 
107. static av_cold int pcm_encode_init(AVCodecContext *avctx)
     ^
108. {
109.     avctx->frame_size = 1;

libavcodec/pcm.c:109:5: 
107. static av_cold int pcm_encode_init(AVCodecContext *avctx)
108. {
109.     avctx->frame_size = 1;
         ^
110.     switch(avctx->codec->id) {
111.     case CODEC_ID_PCM_ALAW:

libavcodec/pcm.c:110:5: 
108. {
109.     avctx->frame_size = 1;
110.     switch(avctx->codec->id) {
         ^
111.     case CODEC_ID_PCM_ALAW:
112.         build_xlaw_table(linear_to_alaw, alaw2linear, 0xd5);

libavcodec/pcm.c:111:5: Switch condition is false. Skipping switch case
109.     avctx->frame_size = 1;
110.     switch(avctx->codec->id) {
111.     case CODEC_ID_PCM_ALAW:
         ^
112.         build_xlaw_table(linear_to_alaw, alaw2linear, 0xd5);
113.         break;

libavcodec/pcm.c:114:5: Switch condition is false. Skipping switch case
112.         build_xlaw_table(linear_to_alaw, alaw2linear, 0xd5);
113.         break;
114.     case CODEC_ID_PCM_MULAW:
         ^
115.         build_xlaw_table(linear_to_ulaw, ulaw2linear, 0xff);
116.         break;

libavcodec/pcm.c:121:5: 
119.     }
120. 
121.     avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);
         ^
122.     avctx->block_align = avctx->channels * avctx->bits_per_coded_sample/8;
123.     avctx->coded_frame= avcodec_alloc_frame();

libavcodec/utils.c:867:1: start of procedure av_get_bits_per_sample()
  865. }
  866. 
  867. int av_get_bits_per_sample(enum CodecID codec_id){
       ^
  868.     switch(codec_id){
  869.     case CODEC_ID_ADPCM_SBPRO_2:

libavcodec/utils.c:868:5: 
  866. 
  867. int av_get_bits_per_sample(enum CodecID codec_id){
  868.     switch(codec_id){
           ^
  869.     case CODEC_ID_ADPCM_SBPRO_2:
  870.         return 2;

libavcodec/utils.c:869:5: Switch condition is false. Skipping switch case
  867. int av_get_bits_per_sample(enum CodecID codec_id){
  868.     switch(codec_id){
  869.     case CODEC_ID_ADPCM_SBPRO_2:
           ^
  870.         return 2;
  871.     case CODEC_ID_ADPCM_SBPRO_3:

libavcodec/utils.c:871:5: Switch condition is false. Skipping switch case
  869.     case CODEC_ID_ADPCM_SBPRO_2:
  870.         return 2;
  871.     case CODEC_ID_ADPCM_SBPRO_3:
           ^
  872.         return 3;
  873.     case CODEC_ID_ADPCM_SBPRO_4:

libavcodec/utils.c:873:5: Switch condition is false. Skipping switch case
  871.     case CODEC_ID_ADPCM_SBPRO_3:
  872.         return 3;
  873.     case CODEC_ID_ADPCM_SBPRO_4:
           ^
  874.     case CODEC_ID_ADPCM_CT:
  875.         return 4;

libavcodec/utils.c:874:5: Switch condition is false. Skipping switch case
  872.         return 3;
  873.     case CODEC_ID_ADPCM_SBPRO_4:
  874.     case CODEC_ID_ADPCM_CT:
           ^
  875.         return 4;
  876.     case CODEC_ID_PCM_ALAW:

libavcodec/utils.c:876:5: Switch condition is false. Skipping switch case
  874.     case CODEC_ID_ADPCM_CT:
  875.         return 4;
  876.     case CODEC_ID_PCM_ALAW:
           ^
  877.     case CODEC_ID_PCM_MULAW:
  878.     case CODEC_ID_PCM_S8:

libavcodec/utils.c:877:5: Switch condition is false. Skipping switch case
  875.         return 4;
  876.     case CODEC_ID_PCM_ALAW:
  877.     case CODEC_ID_PCM_MULAW:
           ^
  878.     case CODEC_ID_PCM_S8:
  879.     case CODEC_ID_PCM_U8:

libavcodec/utils.c:878:5: Switch condition is false. Skipping switch case
  876.     case CODEC_ID_PCM_ALAW:
  877.     case CODEC_ID_PCM_MULAW:
  878.     case CODEC_ID_PCM_S8:
           ^
  879.     case CODEC_ID_PCM_U8:
  880.     case CODEC_ID_PCM_ZORK:

libavcodec/utils.c:879:5: Switch condition is false. Skipping switch case
  877.     case CODEC_ID_PCM_MULAW:
  878.     case CODEC_ID_PCM_S8:
  879.     case CODEC_ID_PCM_U8:
           ^
  880.     case CODEC_ID_PCM_ZORK:
  881.         return 8;

libavcodec/utils.c:880:5: Switch condition is false. Skipping switch case
  878.     case CODEC_ID_PCM_S8:
  879.     case CODEC_ID_PCM_U8:
  880.     case CODEC_ID_PCM_ZORK:
           ^
  881.         return 8;
  882.     case CODEC_ID_PCM_S16BE:

libavcodec/utils.c:882:5: Switch condition is false. Skipping switch case
  880.     case CODEC_ID_PCM_ZORK:
  881.         return 8;
  882.     case CODEC_ID_PCM_S16BE:
           ^
  883.     case CODEC_ID_PCM_S16LE:
  884.     case CODEC_ID_PCM_S16LE_PLANAR:

libavcodec/utils.c:883:5: Switch condition is false. Skipping switch case
  881.         return 8;
  882.     case CODEC_ID_PCM_S16BE:
  883.     case CODEC_ID_PCM_S16LE:
           ^
  884.     case CODEC_ID_PCM_S16LE_PLANAR:
  885.     case CODEC_ID_PCM_U16BE:

libavcodec/utils.c:884:5: Switch condition is false. Skipping switch case
  882.     case CODEC_ID_PCM_S16BE:
  883.     case CODEC_ID_PCM_S16LE:
  884.     case CODEC_ID_PCM_S16LE_PLANAR:
           ^
  885.     case CODEC_ID_PCM_U16BE:
  886.     case CODEC_ID_PCM_U16LE:

libavcodec/utils.c:885:5: Switch condition is false. Skipping switch case
  883.     case CODEC_ID_PCM_S16LE:
  884.     case CODEC_ID_PCM_S16LE_PLANAR:
  885.     case CODEC_ID_PCM_U16BE:
           ^
  886.     case CODEC_ID_PCM_U16LE:
  887.         return 16;

libavcodec/utils.c:886:5: Switch condition is false. Skipping switch case
  884.     case CODEC_ID_PCM_S16LE_PLANAR:
  885.     case CODEC_ID_PCM_U16BE:
  886.     case CODEC_ID_PCM_U16LE:
           ^
  887.         return 16;
  888.     case CODEC_ID_PCM_S24DAUD:

libavcodec/utils.c:888:5: Switch condition is false. Skipping switch case
  886.     case CODEC_ID_PCM_U16LE:
  887.         return 16;
  888.     case CODEC_ID_PCM_S24DAUD:
           ^
  889.     case CODEC_ID_PCM_S24BE:
  890.     case CODEC_ID_PCM_S24LE:

libavcodec/utils.c:889:5: Switch condition is false. Skipping switch case
  887.         return 16;
  888.     case CODEC_ID_PCM_S24DAUD:
  889.     case CODEC_ID_PCM_S24BE:
           ^
  890.     case CODEC_ID_PCM_S24LE:
  891.     case CODEC_ID_PCM_U24BE:

libavcodec/utils.c:890:5: Switch condition is false. Skipping switch case
  888.     case CODEC_ID_PCM_S24DAUD:
  889.     case CODEC_ID_PCM_S24BE:
  890.     case CODEC_ID_PCM_S24LE:
           ^
  891.     case CODEC_ID_PCM_U24BE:
  892.     case CODEC_ID_PCM_U24LE:

libavcodec/utils.c:891:5: Switch condition is false. Skipping switch case
  889.     case CODEC_ID_PCM_S24BE:
  890.     case CODEC_ID_PCM_S24LE:
  891.     case CODEC_ID_PCM_U24BE:
           ^
  892.     case CODEC_ID_PCM_U24LE:
  893.         return 24;

libavcodec/utils.c:892:5: Switch condition is false. Skipping switch case
  890.     case CODEC_ID_PCM_S24LE:
  891.     case CODEC_ID_PCM_U24BE:
  892.     case CODEC_ID_PCM_U24LE:
           ^
  893.         return 24;
  894.     case CODEC_ID_PCM_S32BE:

libavcodec/utils.c:894:5: Switch condition is false. Skipping switch case
  892.     case CODEC_ID_PCM_U24LE:
  893.         return 24;
  894.     case CODEC_ID_PCM_S32BE:
           ^
  895.     case CODEC_ID_PCM_S32LE:
  896.     case CODEC_ID_PCM_U32BE:

libavcodec/utils.c:895:5: Switch condition is false. Skipping switch case
  893.         return 24;
  894.     case CODEC_ID_PCM_S32BE:
  895.     case CODEC_ID_PCM_S32LE:
           ^
  896.     case CODEC_ID_PCM_U32BE:
  897.     case CODEC_ID_PCM_U32LE:

libavcodec/utils.c:896:5: Switch condition is false. Skipping switch case
  894.     case CODEC_ID_PCM_S32BE:
  895.     case CODEC_ID_PCM_S32LE:
  896.     case CODEC_ID_PCM_U32BE:
           ^
  897.     case CODEC_ID_PCM_U32LE:
  898.     case CODEC_ID_PCM_F32BE:

libavcodec/utils.c:897:5: Switch condition is false. Skipping switch case
  895.     case CODEC_ID_PCM_S32LE:
  896.     case CODEC_ID_PCM_U32BE:
  897.     case CODEC_ID_PCM_U32LE:
           ^
  898.     case CODEC_ID_PCM_F32BE:
  899.     case CODEC_ID_PCM_F32LE:

libavcodec/utils.c:898:5: Switch condition is false. Skipping switch case
  896.     case CODEC_ID_PCM_U32BE:
  897.     case CODEC_ID_PCM_U32LE:
  898.     case CODEC_ID_PCM_F32BE:
           ^
  899.     case CODEC_ID_PCM_F32LE:
  900.         return 32;

libavcodec/utils.c:899:5: Switch condition is false. Skipping switch case
  897.     case CODEC_ID_PCM_U32LE:
  898.     case CODEC_ID_PCM_F32BE:
  899.     case CODEC_ID_PCM_F32LE:
           ^
  900.         return 32;
  901.     case CODEC_ID_PCM_F64BE:

libavcodec/utils.c:901:5: Switch condition is false. Skipping switch case
  899.     case CODEC_ID_PCM_F32LE:
  900.         return 32;
  901.     case CODEC_ID_PCM_F64BE:
           ^
  902.     case CODEC_ID_PCM_F64LE:
  903.         return 64;

libavcodec/utils.c:902:5: Switch condition is false. Skipping switch case
  900.         return 32;
  901.     case CODEC_ID_PCM_F64BE:
  902.     case CODEC_ID_PCM_F64LE:
           ^
  903.         return 64;
  904.     default:

libavcodec/utils.c:905:9: 
  903.         return 64;
  904.     default:
  905.         return 0;
               ^
  906.     }
  907. }

libavcodec/utils.c:907:1: return from a call to av_get_bits_per_sample
  905.         return 0;
  906.     }
  907. }
       ^
  908. 
  909. int av_get_bits_per_sample_format(enum SampleFormat sample_fmt) {

libavcodec/pcm.c:122:5: 
120. 
121.     avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);
122.     avctx->block_align = avctx->channels * avctx->bits_per_coded_sample/8;
         ^
123.     avctx->coded_frame= avcodec_alloc_frame();
124.     avctx->coded_frame->key_frame= 1;

libavcodec/pcm.c:123:5: 
121.     avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);
122.     avctx->block_align = avctx->channels * avctx->bits_per_coded_sample/8;
123.     avctx->coded_frame= avcodec_alloc_frame();
         ^
124.     avctx->coded_frame->key_frame= 1;
125. 

libavcodec/utils.c:409:1: start of procedure avcodec_alloc_frame()
  407. }
  408. 
  409. AVFrame *avcodec_alloc_frame(void){
       ^
  410.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  411. 

libavcodec/utils.c:410:5: 
  408. 
  409. AVFrame *avcodec_alloc_frame(void){
  410.     AVFrame *pic= av_malloc(sizeof(AVFrame));
           ^
  411. 
  412.     if(pic==NULL) return NULL;

libavutil/mem.c:47:1: start of procedure av_malloc()
    45.    linker will do it automatically. */
    46. 
    47. void *av_malloc(unsigned int size)
        ^
    48. {
    49.     void *ptr = NULL;

libavutil/mem.c:49:5: 
    47. void *av_malloc(unsigned int size)
    48. {
    49.     void *ptr = NULL;
            ^
    50. #if CONFIG_MEMALIGN_HACK
    51.     long diff;

libavutil/mem.c:55:8: Taking false branch
    53. 
    54.     /* let's disallow possible ambiguous cases */
    55.     if(size > (INT_MAX-16) )
               ^
    56.         return NULL;
    57. 

libavutil/mem.c:66:9: Taking false branch
    64.     ((char*)ptr)[-1]= diff;
    65. #elif HAVE_POSIX_MEMALIGN
    66.     if (posix_memalign(&ptr,16,size))
                ^
    67.         ptr = NULL;
    68. #elif HAVE_MEMALIGN

libavutil/mem.c:99:5: 
     97.     ptr = malloc(size);
     98. #endif
     99.     return ptr;
             ^
    100. }
    101. 

libavutil/mem.c:100:1: return from a call to av_malloc
     98. #endif
     99.     return ptr;
    100. }
         ^
    101. 
    102. void *av_realloc(void *ptr, unsigned int size)

libavcodec/utils.c:412:8: Taking true branch
  410.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  411. 
  412.     if(pic==NULL) return NULL;
              ^
  413. 
  414.     avcodec_get_frame_defaults(pic);

libavcodec/utils.c:412:19: 
  410.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  411. 
  412.     if(pic==NULL) return NULL;
                         ^
  413. 
  414.     avcodec_get_frame_defaults(pic);

libavcodec/utils.c:417:1: return from a call to avcodec_alloc_frame
  415. 
  416.     return pic;
  417. }
       ^
  418. 
  419. int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec)

libavcodec/pcm.c:124:5: 
122.     avctx->block_align = avctx->channels * avctx->bits_per_coded_sample/8;
123.     avctx->coded_frame= avcodec_alloc_frame();
124.     avctx->coded_frame->key_frame= 1;
         ^
125. 
126.     return 0;
