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:1265:1: start of procedure av_get_bits_per_sample()
  1263. }
  1264. 
  1265. int av_get_bits_per_sample(enum CodecID codec_id){
        ^
  1266.     switch(codec_id){
  1267.     case CODEC_ID_ADPCM_SBPRO_2:

libavcodec/utils.c:1266:5: 
  1264. 
  1265. int av_get_bits_per_sample(enum CodecID codec_id){
  1266.     switch(codec_id){
            ^
  1267.     case CODEC_ID_ADPCM_SBPRO_2:
  1268.         return 2;

libavcodec/utils.c:1267:5: Switch condition is false. Skipping switch case
  1265. int av_get_bits_per_sample(enum CodecID codec_id){
  1266.     switch(codec_id){
  1267.     case CODEC_ID_ADPCM_SBPRO_2:
            ^
  1268.         return 2;
  1269.     case CODEC_ID_ADPCM_SBPRO_3:

libavcodec/utils.c:1269:5: Switch condition is false. Skipping switch case
  1267.     case CODEC_ID_ADPCM_SBPRO_2:
  1268.         return 2;
  1269.     case CODEC_ID_ADPCM_SBPRO_3:
            ^
  1270.         return 3;
  1271.     case CODEC_ID_ADPCM_SBPRO_4:

libavcodec/utils.c:1271:5: Switch condition is false. Skipping switch case
  1269.     case CODEC_ID_ADPCM_SBPRO_3:
  1270.         return 3;
  1271.     case CODEC_ID_ADPCM_SBPRO_4:
            ^
  1272.     case CODEC_ID_ADPCM_CT:
  1273.         return 4;

libavcodec/utils.c:1272:5: Switch condition is false. Skipping switch case
  1270.         return 3;
  1271.     case CODEC_ID_ADPCM_SBPRO_4:
  1272.     case CODEC_ID_ADPCM_CT:
            ^
  1273.         return 4;
  1274.     case CODEC_ID_PCM_ALAW:

libavcodec/utils.c:1274:5: Switch condition is false. Skipping switch case
  1272.     case CODEC_ID_ADPCM_CT:
  1273.         return 4;
  1274.     case CODEC_ID_PCM_ALAW:
            ^
  1275.     case CODEC_ID_PCM_MULAW:
  1276.     case CODEC_ID_PCM_S8:

libavcodec/utils.c:1275:5: Switch condition is false. Skipping switch case
  1273.         return 4;
  1274.     case CODEC_ID_PCM_ALAW:
  1275.     case CODEC_ID_PCM_MULAW:
            ^
  1276.     case CODEC_ID_PCM_S8:
  1277.     case CODEC_ID_PCM_U8:

libavcodec/utils.c:1276:5: Switch condition is false. Skipping switch case
  1274.     case CODEC_ID_PCM_ALAW:
  1275.     case CODEC_ID_PCM_MULAW:
  1276.     case CODEC_ID_PCM_S8:
            ^
  1277.     case CODEC_ID_PCM_U8:
  1278.     case CODEC_ID_PCM_ZORK:

libavcodec/utils.c:1277:5: Switch condition is false. Skipping switch case
  1275.     case CODEC_ID_PCM_MULAW:
  1276.     case CODEC_ID_PCM_S8:
  1277.     case CODEC_ID_PCM_U8:
            ^
  1278.     case CODEC_ID_PCM_ZORK:
  1279.         return 8;

libavcodec/utils.c:1278:5: Switch condition is false. Skipping switch case
  1276.     case CODEC_ID_PCM_S8:
  1277.     case CODEC_ID_PCM_U8:
  1278.     case CODEC_ID_PCM_ZORK:
            ^
  1279.         return 8;
  1280.     case CODEC_ID_PCM_S16BE:

libavcodec/utils.c:1280:5: Switch condition is false. Skipping switch case
  1278.     case CODEC_ID_PCM_ZORK:
  1279.         return 8;
  1280.     case CODEC_ID_PCM_S16BE:
            ^
  1281.     case CODEC_ID_PCM_S16LE:
  1282.     case CODEC_ID_PCM_S16LE_PLANAR:

libavcodec/utils.c:1281:5: Switch condition is false. Skipping switch case
  1279.         return 8;
  1280.     case CODEC_ID_PCM_S16BE:
  1281.     case CODEC_ID_PCM_S16LE:
            ^
  1282.     case CODEC_ID_PCM_S16LE_PLANAR:
  1283.     case CODEC_ID_PCM_U16BE:

libavcodec/utils.c:1282:5: Switch condition is false. Skipping switch case
  1280.     case CODEC_ID_PCM_S16BE:
  1281.     case CODEC_ID_PCM_S16LE:
  1282.     case CODEC_ID_PCM_S16LE_PLANAR:
            ^
  1283.     case CODEC_ID_PCM_U16BE:
  1284.     case CODEC_ID_PCM_U16LE:

libavcodec/utils.c:1283:5: Switch condition is false. Skipping switch case
  1281.     case CODEC_ID_PCM_S16LE:
  1282.     case CODEC_ID_PCM_S16LE_PLANAR:
  1283.     case CODEC_ID_PCM_U16BE:
            ^
  1284.     case CODEC_ID_PCM_U16LE:
  1285.         return 16;

libavcodec/utils.c:1284:5: Switch condition is false. Skipping switch case
  1282.     case CODEC_ID_PCM_S16LE_PLANAR:
  1283.     case CODEC_ID_PCM_U16BE:
  1284.     case CODEC_ID_PCM_U16LE:
            ^
  1285.         return 16;
  1286.     case CODEC_ID_PCM_S24DAUD:

libavcodec/utils.c:1286:5: Switch condition is false. Skipping switch case
  1284.     case CODEC_ID_PCM_U16LE:
  1285.         return 16;
  1286.     case CODEC_ID_PCM_S24DAUD:
            ^
  1287.     case CODEC_ID_PCM_S24BE:
  1288.     case CODEC_ID_PCM_S24LE:

libavcodec/utils.c:1287:5: Switch condition is false. Skipping switch case
  1285.         return 16;
  1286.     case CODEC_ID_PCM_S24DAUD:
  1287.     case CODEC_ID_PCM_S24BE:
            ^
  1288.     case CODEC_ID_PCM_S24LE:
  1289.     case CODEC_ID_PCM_U24BE:

libavcodec/utils.c:1288:5: Switch condition is false. Skipping switch case
  1286.     case CODEC_ID_PCM_S24DAUD:
  1287.     case CODEC_ID_PCM_S24BE:
  1288.     case CODEC_ID_PCM_S24LE:
            ^
  1289.     case CODEC_ID_PCM_U24BE:
  1290.     case CODEC_ID_PCM_U24LE:

libavcodec/utils.c:1289:5: Switch condition is false. Skipping switch case
  1287.     case CODEC_ID_PCM_S24BE:
  1288.     case CODEC_ID_PCM_S24LE:
  1289.     case CODEC_ID_PCM_U24BE:
            ^
  1290.     case CODEC_ID_PCM_U24LE:
  1291.         return 24;

libavcodec/utils.c:1290:5: Switch condition is false. Skipping switch case
  1288.     case CODEC_ID_PCM_S24LE:
  1289.     case CODEC_ID_PCM_U24BE:
  1290.     case CODEC_ID_PCM_U24LE:
            ^
  1291.         return 24;
  1292.     case CODEC_ID_PCM_S32BE:

libavcodec/utils.c:1292:5: Switch condition is false. Skipping switch case
  1290.     case CODEC_ID_PCM_U24LE:
  1291.         return 24;
  1292.     case CODEC_ID_PCM_S32BE:
            ^
  1293.     case CODEC_ID_PCM_S32LE:
  1294.     case CODEC_ID_PCM_U32BE:

libavcodec/utils.c:1293:5: Switch condition is false. Skipping switch case
  1291.         return 24;
  1292.     case CODEC_ID_PCM_S32BE:
  1293.     case CODEC_ID_PCM_S32LE:
            ^
  1294.     case CODEC_ID_PCM_U32BE:
  1295.     case CODEC_ID_PCM_U32LE:

libavcodec/utils.c:1294:5: Switch condition is false. Skipping switch case
  1292.     case CODEC_ID_PCM_S32BE:
  1293.     case CODEC_ID_PCM_S32LE:
  1294.     case CODEC_ID_PCM_U32BE:
            ^
  1295.     case CODEC_ID_PCM_U32LE:
  1296.     case CODEC_ID_PCM_F32BE:

libavcodec/utils.c:1295:5: Switch condition is false. Skipping switch case
  1293.     case CODEC_ID_PCM_S32LE:
  1294.     case CODEC_ID_PCM_U32BE:
  1295.     case CODEC_ID_PCM_U32LE:
            ^
  1296.     case CODEC_ID_PCM_F32BE:
  1297.     case CODEC_ID_PCM_F32LE:

libavcodec/utils.c:1296:5: Switch condition is false. Skipping switch case
  1294.     case CODEC_ID_PCM_U32BE:
  1295.     case CODEC_ID_PCM_U32LE:
  1296.     case CODEC_ID_PCM_F32BE:
            ^
  1297.     case CODEC_ID_PCM_F32LE:
  1298.         return 32;

libavcodec/utils.c:1297:5: Switch condition is false. Skipping switch case
  1295.     case CODEC_ID_PCM_U32LE:
  1296.     case CODEC_ID_PCM_F32BE:
  1297.     case CODEC_ID_PCM_F32LE:
            ^
  1298.         return 32;
  1299.     case CODEC_ID_PCM_F64BE:

libavcodec/utils.c:1299:5: Switch condition is false. Skipping switch case
  1297.     case CODEC_ID_PCM_F32LE:
  1298.         return 32;
  1299.     case CODEC_ID_PCM_F64BE:
            ^
  1300.     case CODEC_ID_PCM_F64LE:
  1301.         return 64;

libavcodec/utils.c:1300:5: Switch condition is false. Skipping switch case
  1298.         return 32;
  1299.     case CODEC_ID_PCM_F64BE:
  1300.     case CODEC_ID_PCM_F64LE:
            ^
  1301.         return 64;
  1302.     default:

libavcodec/utils.c:1303:9: 
  1301.         return 64;
  1302.     default:
  1303.         return 0;
                ^
  1304.     }
  1305. }

libavcodec/utils.c:1305:1: return from a call to av_get_bits_per_sample
  1303.         return 0;
  1304.     }
  1305. }
        ^
  1306. 
  1307. 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:796:1: start of procedure avcodec_alloc_frame()
  794. }
  795. 
  796. AVFrame *avcodec_alloc_frame(void){
       ^
  797.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  798. 

libavcodec/utils.c:797:5: 
  795. 
  796. AVFrame *avcodec_alloc_frame(void){
  797.     AVFrame *pic= av_malloc(sizeof(AVFrame));
           ^
  798. 
  799.     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:799:8: Taking true branch
  797.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  798. 
  799.     if(pic==NULL) return NULL;
              ^
  800. 
  801.     avcodec_get_frame_defaults(pic);

libavcodec/utils.c:799:19: 
  797.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  798. 
  799.     if(pic==NULL) return NULL;
                         ^
  800. 
  801.     avcodec_get_frame_defaults(pic);

libavcodec/utils.c:804:1: return from a call to avcodec_alloc_frame
  802. 
  803.     return pic;
  804. }
       ^
  805. 
  806. 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;

static av_cold int pcm_encode_init(AVCodecContext *avctx)
{
    avctx->frame_size = 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;
    }
    avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);
    avctx->block_align = avctx->channels * avctx->bits_per_coded_sample/8;
    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    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    avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);\n    avctx->block_align = avctx->channels * avctx->bits_per_coded_sample/8;\n    avctx->coded_frame= avcodec_alloc_frame();\n    avctx->coded_frame->key_frame= 1;\n    return 0;\n}', 'int av_get_bits_per_sample(enum CodecID codec_id){\n    switch(codec_id){\n    case CODEC_ID_ADPCM_SBPRO_2:\n        return 2;\n    case CODEC_ID_ADPCM_SBPRO_3:\n        return 3;\n    case CODEC_ID_ADPCM_SBPRO_4:\n    case CODEC_ID_ADPCM_CT:\n        return 4;\n    case CODEC_ID_PCM_ALAW:\n    case CODEC_ID_PCM_MULAW:\n    case CODEC_ID_PCM_S8:\n    case CODEC_ID_PCM_U8:\n    case CODEC_ID_PCM_ZORK:\n        return 8;\n    case CODEC_ID_PCM_S16BE:\n    case CODEC_ID_PCM_S16LE:\n    case CODEC_ID_PCM_S16LE_PLANAR:\n    case CODEC_ID_PCM_U16BE:\n    case CODEC_ID_PCM_U16LE:\n        return 16;\n    case CODEC_ID_PCM_S24DAUD:\n    case CODEC_ID_PCM_S24BE:\n    case CODEC_ID_PCM_S24LE:\n    case CODEC_ID_PCM_U24BE:\n    case CODEC_ID_PCM_U24LE:\n        return 24;\n    case CODEC_ID_PCM_S32BE:\n    case CODEC_ID_PCM_S32LE:\n    case CODEC_ID_PCM_U32BE:\n    case CODEC_ID_PCM_U32LE:\n    case CODEC_ID_PCM_F32BE:\n    case CODEC_ID_PCM_F32LE:\n        return 32;\n    case CODEC_ID_PCM_F64BE:\n    case CODEC_ID_PCM_F64LE:\n        return 64;\n    default:\n        return 0;\n    }\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}']