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

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

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

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

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

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

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

libavcodec/utils.c:1586:1: start of procedure av_get_bits_per_sample()
  1584. }
  1585. 
  1586. int av_get_bits_per_sample(enum CodecID codec_id){
        ^
  1587.     switch(codec_id){
  1588.     case CODEC_ID_ADPCM_SBPRO_2:

libavcodec/utils.c:1587:5: 
  1585. 
  1586. int av_get_bits_per_sample(enum CodecID codec_id){
  1587.     switch(codec_id){
            ^
  1588.     case CODEC_ID_ADPCM_SBPRO_2:
  1589.         return 2;

libavcodec/utils.c:1588:5: Switch condition is false. Skipping switch case
  1586. int av_get_bits_per_sample(enum CodecID codec_id){
  1587.     switch(codec_id){
  1588.     case CODEC_ID_ADPCM_SBPRO_2:
            ^
  1589.         return 2;
  1590.     case CODEC_ID_ADPCM_SBPRO_3:

libavcodec/utils.c:1590:5: Switch condition is false. Skipping switch case
  1588.     case CODEC_ID_ADPCM_SBPRO_2:
  1589.         return 2;
  1590.     case CODEC_ID_ADPCM_SBPRO_3:
            ^
  1591.         return 3;
  1592.     case CODEC_ID_ADPCM_SBPRO_4:

libavcodec/utils.c:1592:5: Switch condition is false. Skipping switch case
  1590.     case CODEC_ID_ADPCM_SBPRO_3:
  1591.         return 3;
  1592.     case CODEC_ID_ADPCM_SBPRO_4:
            ^
  1593.     case CODEC_ID_ADPCM_CT:
  1594.     case CODEC_ID_ADPCM_IMA_APC:

libavcodec/utils.c:1593:5: Switch condition is false. Skipping switch case
  1591.         return 3;
  1592.     case CODEC_ID_ADPCM_SBPRO_4:
  1593.     case CODEC_ID_ADPCM_CT:
            ^
  1594.     case CODEC_ID_ADPCM_IMA_APC:
  1595.     case CODEC_ID_ADPCM_IMA_WAV:

libavcodec/utils.c:1594:5: Switch condition is false. Skipping switch case
  1592.     case CODEC_ID_ADPCM_SBPRO_4:
  1593.     case CODEC_ID_ADPCM_CT:
  1594.     case CODEC_ID_ADPCM_IMA_APC:
            ^
  1595.     case CODEC_ID_ADPCM_IMA_WAV:
  1596.     case CODEC_ID_ADPCM_IMA_QT:

libavcodec/utils.c:1595:5: Switch condition is false. Skipping switch case
  1593.     case CODEC_ID_ADPCM_CT:
  1594.     case CODEC_ID_ADPCM_IMA_APC:
  1595.     case CODEC_ID_ADPCM_IMA_WAV:
            ^
  1596.     case CODEC_ID_ADPCM_IMA_QT:
  1597.     case CODEC_ID_ADPCM_SWF:

libavcodec/utils.c:1596:5: Switch condition is false. Skipping switch case
  1594.     case CODEC_ID_ADPCM_IMA_APC:
  1595.     case CODEC_ID_ADPCM_IMA_WAV:
  1596.     case CODEC_ID_ADPCM_IMA_QT:
            ^
  1597.     case CODEC_ID_ADPCM_SWF:
  1598.     case CODEC_ID_ADPCM_MS:

libavcodec/utils.c:1597:5: Switch condition is false. Skipping switch case
  1595.     case CODEC_ID_ADPCM_IMA_WAV:
  1596.     case CODEC_ID_ADPCM_IMA_QT:
  1597.     case CODEC_ID_ADPCM_SWF:
            ^
  1598.     case CODEC_ID_ADPCM_MS:
  1599.     case CODEC_ID_ADPCM_YAMAHA:

libavcodec/utils.c:1598:5: Switch condition is false. Skipping switch case
  1596.     case CODEC_ID_ADPCM_IMA_QT:
  1597.     case CODEC_ID_ADPCM_SWF:
  1598.     case CODEC_ID_ADPCM_MS:
            ^
  1599.     case CODEC_ID_ADPCM_YAMAHA:
  1600.     case CODEC_ID_ADPCM_G722:

libavcodec/utils.c:1599:5: Switch condition is false. Skipping switch case
  1597.     case CODEC_ID_ADPCM_SWF:
  1598.     case CODEC_ID_ADPCM_MS:
  1599.     case CODEC_ID_ADPCM_YAMAHA:
            ^
  1600.     case CODEC_ID_ADPCM_G722:
  1601.         return 4;

libavcodec/utils.c:1600:5: Switch condition is false. Skipping switch case
  1598.     case CODEC_ID_ADPCM_MS:
  1599.     case CODEC_ID_ADPCM_YAMAHA:
  1600.     case CODEC_ID_ADPCM_G722:
            ^
  1601.         return 4;
  1602.     case CODEC_ID_PCM_ALAW:

libavcodec/utils.c:1602:5: Switch condition is false. Skipping switch case
  1600.     case CODEC_ID_ADPCM_G722:
  1601.         return 4;
  1602.     case CODEC_ID_PCM_ALAW:
            ^
  1603.     case CODEC_ID_PCM_MULAW:
  1604.     case CODEC_ID_PCM_S8:

libavcodec/utils.c:1603:5: Switch condition is false. Skipping switch case
  1601.         return 4;
  1602.     case CODEC_ID_PCM_ALAW:
  1603.     case CODEC_ID_PCM_MULAW:
            ^
  1604.     case CODEC_ID_PCM_S8:
  1605.     case CODEC_ID_PCM_U8:

libavcodec/utils.c:1604:5: Switch condition is false. Skipping switch case
  1602.     case CODEC_ID_PCM_ALAW:
  1603.     case CODEC_ID_PCM_MULAW:
  1604.     case CODEC_ID_PCM_S8:
            ^
  1605.     case CODEC_ID_PCM_U8:
  1606.     case CODEC_ID_PCM_ZORK:

libavcodec/utils.c:1605:5: Switch condition is false. Skipping switch case
  1603.     case CODEC_ID_PCM_MULAW:
  1604.     case CODEC_ID_PCM_S8:
  1605.     case CODEC_ID_PCM_U8:
            ^
  1606.     case CODEC_ID_PCM_ZORK:
  1607.         return 8;

libavcodec/utils.c:1606:5: Switch condition is false. Skipping switch case
  1604.     case CODEC_ID_PCM_S8:
  1605.     case CODEC_ID_PCM_U8:
  1606.     case CODEC_ID_PCM_ZORK:
            ^
  1607.         return 8;
  1608.     case CODEC_ID_PCM_S16BE:

libavcodec/utils.c:1608:5: Switch condition is false. Skipping switch case
  1606.     case CODEC_ID_PCM_ZORK:
  1607.         return 8;
  1608.     case CODEC_ID_PCM_S16BE:
            ^
  1609.     case CODEC_ID_PCM_S16LE:
  1610.     case CODEC_ID_PCM_S16LE_PLANAR:

libavcodec/utils.c:1609:5: Switch condition is false. Skipping switch case
  1607.         return 8;
  1608.     case CODEC_ID_PCM_S16BE:
  1609.     case CODEC_ID_PCM_S16LE:
            ^
  1610.     case CODEC_ID_PCM_S16LE_PLANAR:
  1611.     case CODEC_ID_PCM_U16BE:

libavcodec/utils.c:1610:5: Switch condition is false. Skipping switch case
  1608.     case CODEC_ID_PCM_S16BE:
  1609.     case CODEC_ID_PCM_S16LE:
  1610.     case CODEC_ID_PCM_S16LE_PLANAR:
            ^
  1611.     case CODEC_ID_PCM_U16BE:
  1612.     case CODEC_ID_PCM_U16LE:

libavcodec/utils.c:1611:5: Switch condition is false. Skipping switch case
  1609.     case CODEC_ID_PCM_S16LE:
  1610.     case CODEC_ID_PCM_S16LE_PLANAR:
  1611.     case CODEC_ID_PCM_U16BE:
            ^
  1612.     case CODEC_ID_PCM_U16LE:
  1613.         return 16;

libavcodec/utils.c:1612:5: Switch condition is false. Skipping switch case
  1610.     case CODEC_ID_PCM_S16LE_PLANAR:
  1611.     case CODEC_ID_PCM_U16BE:
  1612.     case CODEC_ID_PCM_U16LE:
            ^
  1613.         return 16;
  1614.     case CODEC_ID_PCM_S24DAUD:

libavcodec/utils.c:1614:5: Switch condition is false. Skipping switch case
  1612.     case CODEC_ID_PCM_U16LE:
  1613.         return 16;
  1614.     case CODEC_ID_PCM_S24DAUD:
            ^
  1615.     case CODEC_ID_PCM_S24BE:
  1616.     case CODEC_ID_PCM_S24LE:

libavcodec/utils.c:1615:5: Switch condition is false. Skipping switch case
  1613.         return 16;
  1614.     case CODEC_ID_PCM_S24DAUD:
  1615.     case CODEC_ID_PCM_S24BE:
            ^
  1616.     case CODEC_ID_PCM_S24LE:
  1617.     case CODEC_ID_PCM_U24BE:

libavcodec/utils.c:1616:5: Switch condition is false. Skipping switch case
  1614.     case CODEC_ID_PCM_S24DAUD:
  1615.     case CODEC_ID_PCM_S24BE:
  1616.     case CODEC_ID_PCM_S24LE:
            ^
  1617.     case CODEC_ID_PCM_U24BE:
  1618.     case CODEC_ID_PCM_U24LE:

libavcodec/utils.c:1617:5: Switch condition is false. Skipping switch case
  1615.     case CODEC_ID_PCM_S24BE:
  1616.     case CODEC_ID_PCM_S24LE:
  1617.     case CODEC_ID_PCM_U24BE:
            ^
  1618.     case CODEC_ID_PCM_U24LE:
  1619.         return 24;

libavcodec/utils.c:1618:5: Switch condition is false. Skipping switch case
  1616.     case CODEC_ID_PCM_S24LE:
  1617.     case CODEC_ID_PCM_U24BE:
  1618.     case CODEC_ID_PCM_U24LE:
            ^
  1619.         return 24;
  1620.     case CODEC_ID_PCM_S32BE:

libavcodec/utils.c:1620:5: Switch condition is false. Skipping switch case
  1618.     case CODEC_ID_PCM_U24LE:
  1619.         return 24;
  1620.     case CODEC_ID_PCM_S32BE:
            ^
  1621.     case CODEC_ID_PCM_S32LE:
  1622.     case CODEC_ID_PCM_U32BE:

libavcodec/utils.c:1621:5: Switch condition is false. Skipping switch case
  1619.         return 24;
  1620.     case CODEC_ID_PCM_S32BE:
  1621.     case CODEC_ID_PCM_S32LE:
            ^
  1622.     case CODEC_ID_PCM_U32BE:
  1623.     case CODEC_ID_PCM_U32LE:

libavcodec/utils.c:1622:5: Switch condition is false. Skipping switch case
  1620.     case CODEC_ID_PCM_S32BE:
  1621.     case CODEC_ID_PCM_S32LE:
  1622.     case CODEC_ID_PCM_U32BE:
            ^
  1623.     case CODEC_ID_PCM_U32LE:
  1624.     case CODEC_ID_PCM_F32BE:

libavcodec/utils.c:1623:5: Switch condition is false. Skipping switch case
  1621.     case CODEC_ID_PCM_S32LE:
  1622.     case CODEC_ID_PCM_U32BE:
  1623.     case CODEC_ID_PCM_U32LE:
            ^
  1624.     case CODEC_ID_PCM_F32BE:
  1625.     case CODEC_ID_PCM_F32LE:

libavcodec/utils.c:1624:5: Switch condition is false. Skipping switch case
  1622.     case CODEC_ID_PCM_U32BE:
  1623.     case CODEC_ID_PCM_U32LE:
  1624.     case CODEC_ID_PCM_F32BE:
            ^
  1625.     case CODEC_ID_PCM_F32LE:
  1626.         return 32;

libavcodec/utils.c:1625:5: Switch condition is false. Skipping switch case
  1623.     case CODEC_ID_PCM_U32LE:
  1624.     case CODEC_ID_PCM_F32BE:
  1625.     case CODEC_ID_PCM_F32LE:
            ^
  1626.         return 32;
  1627.     case CODEC_ID_PCM_F64BE:

libavcodec/utils.c:1627:5: Switch condition is false. Skipping switch case
  1625.     case CODEC_ID_PCM_F32LE:
  1626.         return 32;
  1627.     case CODEC_ID_PCM_F64BE:
            ^
  1628.     case CODEC_ID_PCM_F64LE:
  1629.         return 64;

libavcodec/utils.c:1628:5: Switch condition is false. Skipping switch case
  1626.         return 32;
  1627.     case CODEC_ID_PCM_F64BE:
  1628.     case CODEC_ID_PCM_F64LE:
            ^
  1629.         return 64;
  1630.     default:

libavcodec/utils.c:1631:9: 
  1629.         return 64;
  1630.     default:
  1631.         return 0;
                ^
  1632.     }
  1633. }

libavcodec/utils.c:1633:1: return from a call to av_get_bits_per_sample
  1631.         return 0;
  1632.     }
  1633. }
        ^
  1634. 
  1635. #if !HAVE_THREADS

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

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

libavcodec/utils.c:615:1: start of procedure avcodec_alloc_frame()
  613. }
  614. 
  615. AVFrame *avcodec_alloc_frame(void){
       ^
  616.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  617. 

libavcodec/utils.c:616:5: 
  614. 
  615. AVFrame *avcodec_alloc_frame(void){
  616.     AVFrame *pic= av_malloc(sizeof(AVFrame));
           ^
  617. 
  618.     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:618:8: Taking true branch
  616.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  617. 
  618.     if(pic==NULL) return NULL;
              ^
  619. 
  620.     avcodec_get_frame_defaults(pic);

libavcodec/utils.c:618:19: 
  616.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  617. 
  618.     if(pic==NULL) return NULL;
                         ^
  619. 
  620.     avcodec_get_frame_defaults(pic);

libavcodec/utils.c:623:1: return from a call to avcodec_alloc_frame
  621. 
  622.     return pic;
  623. }
       ^
  624. 
  625. int attribute_align_arg avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options)

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

static av_cold int pcm_encode_init(AVCodecContext *avctx)
{
    avctx->frame_size = 0;
    switch(avctx->codec->id) {
    case CODEC_ID_PCM_ALAW:
        pcm_alaw_tableinit();
        break;
    case CODEC_ID_PCM_MULAW:
        pcm_ulaw_tableinit();
        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 = 0;\n    switch(avctx->codec->id) {\n    case CODEC_ID_PCM_ALAW:\n        pcm_alaw_tableinit();\n        break;\n    case CODEC_ID_PCM_MULAW:\n        pcm_ulaw_tableinit();\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    case CODEC_ID_ADPCM_IMA_APC:\n    case CODEC_ID_ADPCM_IMA_WAV:\n    case CODEC_ID_ADPCM_IMA_QT:\n    case CODEC_ID_ADPCM_SWF:\n    case CODEC_ID_ADPCM_MS:\n    case CODEC_ID_ADPCM_YAMAHA:\n    case CODEC_ID_ADPCM_G722:\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(size_t size)\n{\n    void *ptr = NULL;\n#if CONFIG_MEMALIGN_HACK\n    long diff;\n#endif\n    if(size > (INT_MAX-32) )\n        return NULL;\n#if CONFIG_MEMALIGN_HACK\n    ptr = malloc(size+32);\n    if(!ptr)\n        return ptr;\n    diff= ((-(long)ptr - 1)&31) + 1;\n    ptr = (char*)ptr + diff;\n    ((char*)ptr)[-1]= diff;\n#elif HAVE_POSIX_MEMALIGN\n    if (posix_memalign(&ptr,32,size))\n        ptr = NULL;\n#elif HAVE_MEMALIGN\n    ptr = memalign(32,size);\n#else\n    ptr = malloc(size);\n#endif\n    return ptr;\n}']