libavcodec/pcm.c:156: error: Null Dereference
  pointer `avctx->coded_frame` last assigned on line 155 could be null and is dereferenced at line 156, 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.     if (avctx->codec->id==CODEC_ID_PCM_F32BE && avctx->sample_fmt!=SAMPLE_FMT_FLT) {
111.         return -1;

libavcodec/pcm.c:110:9: Taking false branch
108. {
109.     avctx->frame_size = 1;
110.     if (avctx->codec->id==CODEC_ID_PCM_F32BE && avctx->sample_fmt!=SAMPLE_FMT_FLT) {
             ^
111.         return -1;
112.     }

libavcodec/pcm.c:113:5: 
111.         return -1;
112.     }
113.     switch(avctx->codec->id) {
         ^
114.     case CODEC_ID_PCM_ALAW:
115.         build_xlaw_table(linear_to_alaw, alaw2linear, 0xd5);

libavcodec/pcm.c:114:5: Switch condition is false. Skipping switch case
112.     }
113.     switch(avctx->codec->id) {
114.     case CODEC_ID_PCM_ALAW:
         ^
115.         build_xlaw_table(linear_to_alaw, alaw2linear, 0xd5);
116.         break;

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

libavcodec/pcm.c:124:5: 
122.     }
123. 
124.     switch(avctx->codec->id) {
         ^
125.     case CODEC_ID_PCM_S32LE:
126.     case CODEC_ID_PCM_S32BE:

libavcodec/pcm.c:125:5: Switch condition is false. Skipping switch case
123. 
124.     switch(avctx->codec->id) {
125.     case CODEC_ID_PCM_S32LE:
         ^
126.     case CODEC_ID_PCM_S32BE:
127.     case CODEC_ID_PCM_U32LE:

libavcodec/pcm.c:126:5: Switch condition is false. Skipping switch case
124.     switch(avctx->codec->id) {
125.     case CODEC_ID_PCM_S32LE:
126.     case CODEC_ID_PCM_S32BE:
         ^
127.     case CODEC_ID_PCM_U32LE:
128.     case CODEC_ID_PCM_U32BE:

libavcodec/pcm.c:127:5: Switch condition is false. Skipping switch case
125.     case CODEC_ID_PCM_S32LE:
126.     case CODEC_ID_PCM_S32BE:
127.     case CODEC_ID_PCM_U32LE:
         ^
128.     case CODEC_ID_PCM_U32BE:
129.     case CODEC_ID_PCM_F32BE:

libavcodec/pcm.c:128:5: Switch condition is false. Skipping switch case
126.     case CODEC_ID_PCM_S32BE:
127.     case CODEC_ID_PCM_U32LE:
128.     case CODEC_ID_PCM_U32BE:
         ^
129.     case CODEC_ID_PCM_F32BE:
130.         avctx->block_align = 4 * avctx->channels;

libavcodec/pcm.c:129:5: Switch condition is false. Skipping switch case
127.     case CODEC_ID_PCM_U32LE:
128.     case CODEC_ID_PCM_U32BE:
129.     case CODEC_ID_PCM_F32BE:
         ^
130.         avctx->block_align = 4 * avctx->channels;
131.         break;

libavcodec/pcm.c:132:5: Switch condition is false. Skipping switch case
130.         avctx->block_align = 4 * avctx->channels;
131.         break;
132.     case CODEC_ID_PCM_S24LE:
         ^
133.     case CODEC_ID_PCM_S24BE:
134.     case CODEC_ID_PCM_U24LE:

libavcodec/pcm.c:133:5: Switch condition is false. Skipping switch case
131.         break;
132.     case CODEC_ID_PCM_S24LE:
133.     case CODEC_ID_PCM_S24BE:
         ^
134.     case CODEC_ID_PCM_U24LE:
135.     case CODEC_ID_PCM_U24BE:

libavcodec/pcm.c:134:5: Switch condition is false. Skipping switch case
132.     case CODEC_ID_PCM_S24LE:
133.     case CODEC_ID_PCM_S24BE:
134.     case CODEC_ID_PCM_U24LE:
         ^
135.     case CODEC_ID_PCM_U24BE:
136.     case CODEC_ID_PCM_S24DAUD:

libavcodec/pcm.c:135:5: Switch condition is false. Skipping switch case
133.     case CODEC_ID_PCM_S24BE:
134.     case CODEC_ID_PCM_U24LE:
135.     case CODEC_ID_PCM_U24BE:
         ^
136.     case CODEC_ID_PCM_S24DAUD:
137.         avctx->block_align = 3 * avctx->channels;

libavcodec/pcm.c:136:5: Switch condition is false. Skipping switch case
134.     case CODEC_ID_PCM_U24LE:
135.     case CODEC_ID_PCM_U24BE:
136.     case CODEC_ID_PCM_S24DAUD:
         ^
137.         avctx->block_align = 3 * avctx->channels;
138.         break;

libavcodec/pcm.c:139:5: Switch condition is true. Entering switch case
137.         avctx->block_align = 3 * avctx->channels;
138.         break;
139.     case CODEC_ID_PCM_S16LE:
         ^
140.     case CODEC_ID_PCM_S16BE:
141.     case CODEC_ID_PCM_U16LE:

libavcodec/pcm.c:143:9: 
141.     case CODEC_ID_PCM_U16LE:
142.     case CODEC_ID_PCM_U16BE:
143.         avctx->block_align = 2 * avctx->channels;
             ^
144.         break;
145.     case CODEC_ID_PCM_S8:

libavcodec/pcm.c:155:5: 
153.     }
154. 
155.     avctx->coded_frame= avcodec_alloc_frame();
         ^
156.     avctx->coded_frame->key_frame= 1;
157. 

libavcodec/utils.c:799:1: start of procedure avcodec_alloc_frame()
  797. }
  798. 
  799. AVFrame *avcodec_alloc_frame(void){
       ^
  800.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  801. 

libavcodec/utils.c:800:5: 
  798. 
  799. AVFrame *avcodec_alloc_frame(void){
  800.     AVFrame *pic= av_malloc(sizeof(AVFrame));
           ^
  801. 
  802.     if(pic==NULL) return NULL;

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)

libavcodec/utils.c:802:8: Taking true branch
  800.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  801. 
  802.     if(pic==NULL) return NULL;
              ^
  803. 
  804.     avcodec_get_frame_defaults(pic);

libavcodec/utils.c:802:19: 
  800.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  801. 
  802.     if(pic==NULL) return NULL;
                         ^
  803. 
  804.     avcodec_get_frame_defaults(pic);

libavcodec/utils.c:807:1: return from a call to avcodec_alloc_frame
  805. 
  806.     return pic;
  807. }
       ^
  808. 
  809. int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec)

libavcodec/pcm.c:156:5: 
154. 
155.     avctx->coded_frame= avcodec_alloc_frame();
156.     avctx->coded_frame->key_frame= 1;
         ^
157. 
158.     return 0;

static av_cold int pcm_encode_init(AVCodecContext *avctx)
{
    avctx->frame_size = 1;
    if (avctx->codec->id==CODEC_ID_PCM_F32BE && avctx->sample_fmt!=SAMPLE_FMT_FLT) {
        return -1;
    }
    switch(avctx->codec->id) {
    case CODEC_ID_PCM_ALAW:
        build_xlaw_table(linear_to_alaw, alaw2linear, 0xd5);
        break;
    case CODEC_ID_PCM_MULAW:
        build_xlaw_table(linear_to_ulaw, ulaw2linear, 0xff);
        break;
    default:
        break;
    }
    switch(avctx->codec->id) {
    case CODEC_ID_PCM_S32LE:
    case CODEC_ID_PCM_S32BE:
    case CODEC_ID_PCM_U32LE:
    case CODEC_ID_PCM_U32BE:
    case CODEC_ID_PCM_F32BE:
        avctx->block_align = 4 * avctx->channels;
        break;
    case CODEC_ID_PCM_S24LE:
    case CODEC_ID_PCM_S24BE:
    case CODEC_ID_PCM_U24LE:
    case CODEC_ID_PCM_U24BE:
    case CODEC_ID_PCM_S24DAUD:
        avctx->block_align = 3 * avctx->channels;
        break;
    case CODEC_ID_PCM_S16LE:
    case CODEC_ID_PCM_S16BE:
    case CODEC_ID_PCM_U16LE:
    case CODEC_ID_PCM_U16BE:
        avctx->block_align = 2 * avctx->channels;
        break;
    case CODEC_ID_PCM_S8:
    case CODEC_ID_PCM_U8:
    case CODEC_ID_PCM_MULAW:
    case CODEC_ID_PCM_ALAW:
        avctx->block_align = avctx->channels;
        break;
    default:
        break;
    }
    avctx->coded_frame= avcodec_alloc_frame();
    avctx->coded_frame->key_frame= 1;
    return 0;
}
['static av_cold int pcm_encode_init(AVCodecContext *avctx)\n{\n    avctx->frame_size = 1;\n    if (avctx->codec->id==CODEC_ID_PCM_F32BE && avctx->sample_fmt!=SAMPLE_FMT_FLT) {\n        return -1;\n    }\n    switch(avctx->codec->id) {\n    case CODEC_ID_PCM_ALAW:\n        build_xlaw_table(linear_to_alaw, alaw2linear, 0xd5);\n        break;\n    case CODEC_ID_PCM_MULAW:\n        build_xlaw_table(linear_to_ulaw, ulaw2linear, 0xff);\n        break;\n    default:\n        break;\n    }\n    switch(avctx->codec->id) {\n    case CODEC_ID_PCM_S32LE:\n    case CODEC_ID_PCM_S32BE:\n    case CODEC_ID_PCM_U32LE:\n    case CODEC_ID_PCM_U32BE:\n    case CODEC_ID_PCM_F32BE:\n        avctx->block_align = 4 * avctx->channels;\n        break;\n    case CODEC_ID_PCM_S24LE:\n    case CODEC_ID_PCM_S24BE:\n    case CODEC_ID_PCM_U24LE:\n    case CODEC_ID_PCM_U24BE:\n    case CODEC_ID_PCM_S24DAUD:\n        avctx->block_align = 3 * avctx->channels;\n        break;\n    case CODEC_ID_PCM_S16LE:\n    case CODEC_ID_PCM_S16BE:\n    case CODEC_ID_PCM_U16LE:\n    case CODEC_ID_PCM_U16BE:\n        avctx->block_align = 2 * avctx->channels;\n        break;\n    case CODEC_ID_PCM_S8:\n    case CODEC_ID_PCM_U8:\n    case CODEC_ID_PCM_MULAW:\n    case CODEC_ID_PCM_ALAW:\n        avctx->block_align = avctx->channels;\n        break;\n    default:\n        break;\n    }\n    avctx->coded_frame= avcodec_alloc_frame();\n    avctx->coded_frame->key_frame= 1;\n    return 0;\n}', 'AVFrame *avcodec_alloc_frame(void){\n    AVFrame *pic= av_malloc(sizeof(AVFrame));\n    if(pic==NULL) return NULL;\n    avcodec_get_frame_defaults(pic);\n    return pic;\n}', 'void *av_malloc(unsigned int size)\n{\n    void *ptr;\n#ifdef CONFIG_MEMALIGN_HACK\n    long diff;\n#endif\n    if(size > (INT_MAX-16) )\n        return NULL;\n#ifdef CONFIG_MEMALIGN_HACK\n    ptr = malloc(size+16);\n    if(!ptr)\n        return ptr;\n    diff= ((-(long)ptr - 1)&15) + 1;\n    ptr = (char*)ptr + diff;\n    ((char*)ptr)[-1]= diff;\n#elif defined (HAVE_MEMALIGN)\n    ptr = memalign(16,size);\n#else\n    ptr = malloc(size);\n#endif\n    return ptr;\n}']