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

libavcodec/pcm.c:34:1: start of procedure pcm_encode_init()
32. #define MAX_CHANNELS 64
33. 
34. static av_cold int pcm_encode_init(AVCodecContext *avctx)
    ^
35. {
36.     avctx->frame_size = 0;

libavcodec/pcm.c:36:5: 
34. static av_cold int pcm_encode_init(AVCodecContext *avctx)
35. {
36.     avctx->frame_size = 0;
        ^
37.     switch(avctx->codec->id) {
38.     case CODEC_ID_PCM_ALAW:

libavcodec/pcm.c:37:5: 
35. {
36.     avctx->frame_size = 0;
37.     switch(avctx->codec->id) {
        ^
38.     case CODEC_ID_PCM_ALAW:
39.         pcm_alaw_tableinit();

libavcodec/pcm.c:38:5: Switch condition is false. Skipping switch case
36.     avctx->frame_size = 0;
37.     switch(avctx->codec->id) {
38.     case CODEC_ID_PCM_ALAW:
        ^
39.         pcm_alaw_tableinit();
40.         break;

libavcodec/pcm.c:41:5: Switch condition is false. Skipping switch case
39.         pcm_alaw_tableinit();
40.         break;
41.     case CODEC_ID_PCM_MULAW:
        ^
42.         pcm_ulaw_tableinit();
43.         break;

libavcodec/pcm.c:48:5: 
46.     }
47. 
48.     avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);
        ^
49.     avctx->block_align = avctx->channels * avctx->bits_per_coded_sample/8;
50.     avctx->coded_frame= avcodec_alloc_frame();

libavcodec/utils.c:1379:1: start of procedure av_get_bits_per_sample()
  1377. #endif
  1378. 
  1379. int av_get_bits_per_sample(enum CodecID codec_id){
        ^
  1380.     switch(codec_id){
  1381.     case CODEC_ID_ADPCM_SBPRO_2:

libavcodec/utils.c:1380:5: 
  1378. 
  1379. int av_get_bits_per_sample(enum CodecID codec_id){
  1380.     switch(codec_id){
            ^
  1381.     case CODEC_ID_ADPCM_SBPRO_2:
  1382.         return 2;

libavcodec/utils.c:1381:5: Switch condition is false. Skipping switch case
  1379. int av_get_bits_per_sample(enum CodecID codec_id){
  1380.     switch(codec_id){
  1381.     case CODEC_ID_ADPCM_SBPRO_2:
            ^
  1382.         return 2;
  1383.     case CODEC_ID_ADPCM_SBPRO_3:

libavcodec/utils.c:1383:5: Switch condition is false. Skipping switch case
  1381.     case CODEC_ID_ADPCM_SBPRO_2:
  1382.         return 2;
  1383.     case CODEC_ID_ADPCM_SBPRO_3:
            ^
  1384.         return 3;
  1385.     case CODEC_ID_ADPCM_SBPRO_4:

libavcodec/utils.c:1385:5: Switch condition is false. Skipping switch case
  1383.     case CODEC_ID_ADPCM_SBPRO_3:
  1384.         return 3;
  1385.     case CODEC_ID_ADPCM_SBPRO_4:
            ^
  1386.     case CODEC_ID_ADPCM_CT:
  1387.     case CODEC_ID_ADPCM_IMA_WAV:

libavcodec/utils.c:1386:5: Switch condition is false. Skipping switch case
  1384.         return 3;
  1385.     case CODEC_ID_ADPCM_SBPRO_4:
  1386.     case CODEC_ID_ADPCM_CT:
            ^
  1387.     case CODEC_ID_ADPCM_IMA_WAV:
  1388.     case CODEC_ID_ADPCM_IMA_QT:

libavcodec/utils.c:1387:5: Switch condition is false. Skipping switch case
  1385.     case CODEC_ID_ADPCM_SBPRO_4:
  1386.     case CODEC_ID_ADPCM_CT:
  1387.     case CODEC_ID_ADPCM_IMA_WAV:
            ^
  1388.     case CODEC_ID_ADPCM_IMA_QT:
  1389.     case CODEC_ID_ADPCM_SWF:

libavcodec/utils.c:1388:5: Switch condition is false. Skipping switch case
  1386.     case CODEC_ID_ADPCM_CT:
  1387.     case CODEC_ID_ADPCM_IMA_WAV:
  1388.     case CODEC_ID_ADPCM_IMA_QT:
            ^
  1389.     case CODEC_ID_ADPCM_SWF:
  1390.     case CODEC_ID_ADPCM_MS:

libavcodec/utils.c:1389:5: Switch condition is false. Skipping switch case
  1387.     case CODEC_ID_ADPCM_IMA_WAV:
  1388.     case CODEC_ID_ADPCM_IMA_QT:
  1389.     case CODEC_ID_ADPCM_SWF:
            ^
  1390.     case CODEC_ID_ADPCM_MS:
  1391.     case CODEC_ID_ADPCM_YAMAHA:

libavcodec/utils.c:1390:5: Switch condition is false. Skipping switch case
  1388.     case CODEC_ID_ADPCM_IMA_QT:
  1389.     case CODEC_ID_ADPCM_SWF:
  1390.     case CODEC_ID_ADPCM_MS:
            ^
  1391.     case CODEC_ID_ADPCM_YAMAHA:
  1392.     case CODEC_ID_ADPCM_G722:

libavcodec/utils.c:1391:5: Switch condition is false. Skipping switch case
  1389.     case CODEC_ID_ADPCM_SWF:
  1390.     case CODEC_ID_ADPCM_MS:
  1391.     case CODEC_ID_ADPCM_YAMAHA:
            ^
  1392.     case CODEC_ID_ADPCM_G722:
  1393.         return 4;

libavcodec/utils.c:1392:5: Switch condition is false. Skipping switch case
  1390.     case CODEC_ID_ADPCM_MS:
  1391.     case CODEC_ID_ADPCM_YAMAHA:
  1392.     case CODEC_ID_ADPCM_G722:
            ^
  1393.         return 4;
  1394.     case CODEC_ID_PCM_ALAW:

libavcodec/utils.c:1394:5: Switch condition is false. Skipping switch case
  1392.     case CODEC_ID_ADPCM_G722:
  1393.         return 4;
  1394.     case CODEC_ID_PCM_ALAW:
            ^
  1395.     case CODEC_ID_PCM_MULAW:
  1396.     case CODEC_ID_PCM_S8:

libavcodec/utils.c:1395:5: Switch condition is false. Skipping switch case
  1393.         return 4;
  1394.     case CODEC_ID_PCM_ALAW:
  1395.     case CODEC_ID_PCM_MULAW:
            ^
  1396.     case CODEC_ID_PCM_S8:
  1397.     case CODEC_ID_PCM_U8:

libavcodec/utils.c:1396:5: Switch condition is false. Skipping switch case
  1394.     case CODEC_ID_PCM_ALAW:
  1395.     case CODEC_ID_PCM_MULAW:
  1396.     case CODEC_ID_PCM_S8:
            ^
  1397.     case CODEC_ID_PCM_U8:
  1398.     case CODEC_ID_PCM_ZORK:

libavcodec/utils.c:1397:5: Switch condition is false. Skipping switch case
  1395.     case CODEC_ID_PCM_MULAW:
  1396.     case CODEC_ID_PCM_S8:
  1397.     case CODEC_ID_PCM_U8:
            ^
  1398.     case CODEC_ID_PCM_ZORK:
  1399.         return 8;

libavcodec/utils.c:1398:5: Switch condition is false. Skipping switch case
  1396.     case CODEC_ID_PCM_S8:
  1397.     case CODEC_ID_PCM_U8:
  1398.     case CODEC_ID_PCM_ZORK:
            ^
  1399.         return 8;
  1400.     case CODEC_ID_PCM_S16BE:

libavcodec/utils.c:1400:5: Switch condition is false. Skipping switch case
  1398.     case CODEC_ID_PCM_ZORK:
  1399.         return 8;
  1400.     case CODEC_ID_PCM_S16BE:
            ^
  1401.     case CODEC_ID_PCM_S16LE:
  1402.     case CODEC_ID_PCM_S16LE_PLANAR:

libavcodec/utils.c:1401:5: Switch condition is false. Skipping switch case
  1399.         return 8;
  1400.     case CODEC_ID_PCM_S16BE:
  1401.     case CODEC_ID_PCM_S16LE:
            ^
  1402.     case CODEC_ID_PCM_S16LE_PLANAR:
  1403.     case CODEC_ID_PCM_U16BE:

libavcodec/utils.c:1402:5: Switch condition is false. Skipping switch case
  1400.     case CODEC_ID_PCM_S16BE:
  1401.     case CODEC_ID_PCM_S16LE:
  1402.     case CODEC_ID_PCM_S16LE_PLANAR:
            ^
  1403.     case CODEC_ID_PCM_U16BE:
  1404.     case CODEC_ID_PCM_U16LE:

libavcodec/utils.c:1403:5: Switch condition is false. Skipping switch case
  1401.     case CODEC_ID_PCM_S16LE:
  1402.     case CODEC_ID_PCM_S16LE_PLANAR:
  1403.     case CODEC_ID_PCM_U16BE:
            ^
  1404.     case CODEC_ID_PCM_U16LE:
  1405.         return 16;

libavcodec/utils.c:1404:5: Switch condition is false. Skipping switch case
  1402.     case CODEC_ID_PCM_S16LE_PLANAR:
  1403.     case CODEC_ID_PCM_U16BE:
  1404.     case CODEC_ID_PCM_U16LE:
            ^
  1405.         return 16;
  1406.     case CODEC_ID_PCM_S24DAUD:

libavcodec/utils.c:1406:5: Switch condition is false. Skipping switch case
  1404.     case CODEC_ID_PCM_U16LE:
  1405.         return 16;
  1406.     case CODEC_ID_PCM_S24DAUD:
            ^
  1407.     case CODEC_ID_PCM_S24BE:
  1408.     case CODEC_ID_PCM_S24LE:

libavcodec/utils.c:1407:5: Switch condition is false. Skipping switch case
  1405.         return 16;
  1406.     case CODEC_ID_PCM_S24DAUD:
  1407.     case CODEC_ID_PCM_S24BE:
            ^
  1408.     case CODEC_ID_PCM_S24LE:
  1409.     case CODEC_ID_PCM_U24BE:

libavcodec/utils.c:1408:5: Switch condition is false. Skipping switch case
  1406.     case CODEC_ID_PCM_S24DAUD:
  1407.     case CODEC_ID_PCM_S24BE:
  1408.     case CODEC_ID_PCM_S24LE:
            ^
  1409.     case CODEC_ID_PCM_U24BE:
  1410.     case CODEC_ID_PCM_U24LE:

libavcodec/utils.c:1409:5: Switch condition is false. Skipping switch case
  1407.     case CODEC_ID_PCM_S24BE:
  1408.     case CODEC_ID_PCM_S24LE:
  1409.     case CODEC_ID_PCM_U24BE:
            ^
  1410.     case CODEC_ID_PCM_U24LE:
  1411.         return 24;

libavcodec/utils.c:1410:5: Switch condition is false. Skipping switch case
  1408.     case CODEC_ID_PCM_S24LE:
  1409.     case CODEC_ID_PCM_U24BE:
  1410.     case CODEC_ID_PCM_U24LE:
            ^
  1411.         return 24;
  1412.     case CODEC_ID_PCM_S32BE:

libavcodec/utils.c:1412:5: Switch condition is false. Skipping switch case
  1410.     case CODEC_ID_PCM_U24LE:
  1411.         return 24;
  1412.     case CODEC_ID_PCM_S32BE:
            ^
  1413.     case CODEC_ID_PCM_S32LE:
  1414.     case CODEC_ID_PCM_U32BE:

libavcodec/utils.c:1413:5: Switch condition is false. Skipping switch case
  1411.         return 24;
  1412.     case CODEC_ID_PCM_S32BE:
  1413.     case CODEC_ID_PCM_S32LE:
            ^
  1414.     case CODEC_ID_PCM_U32BE:
  1415.     case CODEC_ID_PCM_U32LE:

libavcodec/utils.c:1414:5: Switch condition is false. Skipping switch case
  1412.     case CODEC_ID_PCM_S32BE:
  1413.     case CODEC_ID_PCM_S32LE:
  1414.     case CODEC_ID_PCM_U32BE:
            ^
  1415.     case CODEC_ID_PCM_U32LE:
  1416.     case CODEC_ID_PCM_F32BE:

libavcodec/utils.c:1415:5: Switch condition is false. Skipping switch case
  1413.     case CODEC_ID_PCM_S32LE:
  1414.     case CODEC_ID_PCM_U32BE:
  1415.     case CODEC_ID_PCM_U32LE:
            ^
  1416.     case CODEC_ID_PCM_F32BE:
  1417.     case CODEC_ID_PCM_F32LE:

libavcodec/utils.c:1416:5: Switch condition is false. Skipping switch case
  1414.     case CODEC_ID_PCM_U32BE:
  1415.     case CODEC_ID_PCM_U32LE:
  1416.     case CODEC_ID_PCM_F32BE:
            ^
  1417.     case CODEC_ID_PCM_F32LE:
  1418.         return 32;

libavcodec/utils.c:1417:5: Switch condition is false. Skipping switch case
  1415.     case CODEC_ID_PCM_U32LE:
  1416.     case CODEC_ID_PCM_F32BE:
  1417.     case CODEC_ID_PCM_F32LE:
            ^
  1418.         return 32;
  1419.     case CODEC_ID_PCM_F64BE:

libavcodec/utils.c:1419:5: Switch condition is false. Skipping switch case
  1417.     case CODEC_ID_PCM_F32LE:
  1418.         return 32;
  1419.     case CODEC_ID_PCM_F64BE:
            ^
  1420.     case CODEC_ID_PCM_F64LE:
  1421.         return 64;

libavcodec/utils.c:1420:5: Switch condition is false. Skipping switch case
  1418.         return 32;
  1419.     case CODEC_ID_PCM_F64BE:
  1420.     case CODEC_ID_PCM_F64LE:
            ^
  1421.         return 64;
  1422.     default:

libavcodec/utils.c:1423:9: 
  1421.         return 64;
  1422.     default:
  1423.         return 0;
                ^
  1424.     }
  1425. }

libavcodec/utils.c:1425:1: return from a call to av_get_bits_per_sample
  1423.         return 0;
  1424.     }
  1425. }
        ^
  1426. 
  1427. #if FF_API_OLD_SAMPLE_FMT

libavcodec/pcm.c:49:5: 
47. 
48.     avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);
49.     avctx->block_align = avctx->channels * avctx->bits_per_coded_sample/8;
        ^
50.     avctx->coded_frame= avcodec_alloc_frame();
51.     avctx->coded_frame->key_frame= 1;

libavcodec/pcm.c:50:5: 
48.     avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);
49.     avctx->block_align = avctx->channels * avctx->bits_per_coded_sample/8;
50.     avctx->coded_frame= avcodec_alloc_frame();
        ^
51.     avctx->coded_frame->key_frame= 1;
52. 

libavcodec/utils.c:591:1: start of procedure avcodec_alloc_frame()
  589. }
  590. 
  591. AVFrame *avcodec_alloc_frame(void){
       ^
  592.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  593. 

libavcodec/utils.c:592:5: 
  590. 
  591. AVFrame *avcodec_alloc_frame(void){
  592.     AVFrame *pic= av_malloc(sizeof(AVFrame));
           ^
  593. 
  594.     if(pic==NULL) return NULL;

libavutil/mem.c:64:1: start of procedure av_malloc()
    62.    linker will do it automatically. */
    63. 
    64. void *av_malloc(size_t size)
        ^
    65. {
    66.     void *ptr = NULL;

libavutil/mem.c:66:5: 
    64. void *av_malloc(size_t size)
    65. {
    66.     void *ptr = NULL;
            ^
    67. #if CONFIG_MEMALIGN_HACK
    68.     long diff;

libavutil/mem.c:72:8: Taking false branch
    70. 
    71.     /* let's disallow possible ambiguous cases */
    72.     if(size > (INT_MAX-32) )
               ^
    73.         return NULL;
    74. 

libavutil/mem.c:83:9: Taking false branch
    81.     ((char*)ptr)[-1]= diff;
    82. #elif HAVE_POSIX_MEMALIGN
    83.     if (posix_memalign(&ptr,32,size))
                ^
    84.         ptr = NULL;
    85. #elif HAVE_MEMALIGN

libavutil/mem.c:114:5: 
    112.     ptr = malloc(size);
    113. #endif
    114.     return ptr;
             ^
    115. }
    116. 

libavutil/mem.c:115:1: return from a call to av_malloc
    113. #endif
    114.     return ptr;
    115. }
         ^
    116. 
    117. void *av_realloc(void *ptr, size_t size)

libavcodec/utils.c:594:8: Taking true branch
  592.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  593. 
  594.     if(pic==NULL) return NULL;
              ^
  595. 
  596.     avcodec_get_frame_defaults(pic);

libavcodec/utils.c:594:19: 
  592.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  593. 
  594.     if(pic==NULL) return NULL;
                         ^
  595. 
  596.     avcodec_get_frame_defaults(pic);

libavcodec/utils.c:599:1: return from a call to avcodec_alloc_frame
  597. 
  598.     return pic;
  599. }
       ^
  600. 
  601. #if FF_API_AVCODEC_OPEN

libavcodec/pcm.c:51:5: 
49.     avctx->block_align = avctx->channels * avctx->bits_per_coded_sample/8;
50.     avctx->coded_frame= avcodec_alloc_frame();
51.     avctx->coded_frame->key_frame= 1;
        ^
52. 
53.     return 0;
