libavcodec/vorbis_enc.c:966: error: Null Dereference
  pointer `avccontext->coded_frame` last assigned on line 965 could be null and is dereferenced at line 966, column 5.

libavcodec/vorbis_enc.c:944:1: start of procedure vorbis_encode_init()
942. }
943. 
944. static av_cold int vorbis_encode_init(AVCodecContext *avccontext)
     ^
945. {
946.     vorbis_enc_context *venc = avccontext->priv_data;

libavcodec/vorbis_enc.c:946:5: 
944. static av_cold int vorbis_encode_init(AVCodecContext *avccontext)
945. {
946.     vorbis_enc_context *venc = avccontext->priv_data;
         ^
947. 
948.     if (avccontext->channels != 2) {

libavcodec/vorbis_enc.c:948:9: Taking false branch
946.     vorbis_enc_context *venc = avccontext->priv_data;
947. 
948.     if (avccontext->channels != 2) {
             ^
949.         av_log(avccontext, AV_LOG_ERROR, "Current FFmpeg Vorbis encoder only supports 2 channels.\n");
950.         return -1;

libavcodec/vorbis_enc.c:953:5: Skipping create_vorbis_context(): empty list of specs
951.     }
952. 
953.     create_vorbis_context(venc, avccontext);
         ^
954. 
955.     if (avccontext->flags & CODEC_FLAG_QSCALE)

libavcodec/vorbis_enc.c:955:9: Taking true branch
953.     create_vorbis_context(venc, avccontext);
954. 
955.     if (avccontext->flags & CODEC_FLAG_QSCALE)
             ^
956.         venc->quality = avccontext->global_quality / (float)FF_QP2LAMBDA / 10.;
957.     else

libavcodec/vorbis_enc.c:956:9: 
954. 
955.     if (avccontext->flags & CODEC_FLAG_QSCALE)
956.         venc->quality = avccontext->global_quality / (float)FF_QP2LAMBDA / 10.;
             ^
957.     else
958.         venc->quality = 0.03;

libavcodec/vorbis_enc.c:959:5: 
957.     else
958.         venc->quality = 0.03;
959.     venc->quality *= venc->quality;
         ^
960. 
961.     avccontext->extradata_size = put_main_header(venc, (uint8_t**)&avccontext->extradata);

libavcodec/vorbis_enc.c:961:5: Skipping put_main_header(): empty list of specs
959.     venc->quality *= venc->quality;
960. 
961.     avccontext->extradata_size = put_main_header(venc, (uint8_t**)&avccontext->extradata);
         ^
962. 
963.     avccontext->frame_size     = 1 << (venc->log2_blocksize[0] - 1);

libavcodec/vorbis_enc.c:963:5: 
961.     avccontext->extradata_size = put_main_header(venc, (uint8_t**)&avccontext->extradata);
962. 
963.     avccontext->frame_size     = 1 << (venc->log2_blocksize[0] - 1);
         ^
964. 
965.     avccontext->coded_frame            = avcodec_alloc_frame();

libavcodec/vorbis_enc.c:965:5: 
963.     avccontext->frame_size     = 1 << (venc->log2_blocksize[0] - 1);
964. 
965.     avccontext->coded_frame            = avcodec_alloc_frame();
         ^
966.     avccontext->coded_frame->key_frame = 1;
967. 

libavcodec/utils.c:452:1: start of procedure avcodec_alloc_frame()
  450. }
  451. 
  452. AVFrame *avcodec_alloc_frame(void){
       ^
  453.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  454. 

libavcodec/utils.c:453:5: 
  451. 
  452. AVFrame *avcodec_alloc_frame(void){
  453.     AVFrame *pic= av_malloc(sizeof(AVFrame));
           ^
  454. 
  455.     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(unsigned int size)
        ^
    65. {
    66.     void *ptr = NULL;

libavutil/mem.c:66:5: 
    64. void *av_malloc(unsigned int 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-16) )
               ^
    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,16,size))
                ^
    84.         ptr = NULL;
    85. #elif HAVE_MEMALIGN

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

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

libavcodec/utils.c:455:8: Taking true branch
  453.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  454. 
  455.     if(pic==NULL) return NULL;
              ^
  456. 
  457.     avcodec_get_frame_defaults(pic);

libavcodec/utils.c:455:19: 
  453.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  454. 
  455.     if(pic==NULL) return NULL;
                         ^
  456. 
  457.     avcodec_get_frame_defaults(pic);

libavcodec/utils.c:460:1: return from a call to avcodec_alloc_frame
  458. 
  459.     return pic;
  460. }
       ^
  461. 
  462. int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec)

libavcodec/vorbis_enc.c:966:5: 
964. 
965.     avccontext->coded_frame            = avcodec_alloc_frame();
966.     avccontext->coded_frame->key_frame = 1;
         ^
967. 
968.     return 0;

static av_cold int vorbis_encode_init(AVCodecContext *avccontext)
{
    vorbis_enc_context *venc = avccontext->priv_data;
    if (avccontext->channels != 2) {
        av_log(avccontext, AV_LOG_ERROR, "Current FFmpeg Vorbis encoder only supports 2 channels.\n");
        return -1;
    }
    create_vorbis_context(venc, avccontext);
    if (avccontext->flags & CODEC_FLAG_QSCALE)
        venc->quality = avccontext->global_quality / (float)FF_QP2LAMBDA / 10.;
    else
        venc->quality = 0.03;
    venc->quality *= venc->quality;
    avccontext->extradata_size = put_main_header(venc, (uint8_t**)&avccontext->extradata);
    avccontext->frame_size     = 1 << (venc->log2_blocksize[0] - 1);
    avccontext->coded_frame            = avcodec_alloc_frame();
    avccontext->coded_frame->key_frame = 1;
    return 0;
}
['static av_cold int vorbis_encode_init(AVCodecContext *avccontext)\n{\n    vorbis_enc_context *venc = avccontext->priv_data;\n    if (avccontext->channels != 2) {\n        av_log(avccontext, AV_LOG_ERROR, "Current FFmpeg Vorbis encoder only supports 2 channels.\\n");\n        return -1;\n    }\n    create_vorbis_context(venc, avccontext);\n    if (avccontext->flags & CODEC_FLAG_QSCALE)\n        venc->quality = avccontext->global_quality / (float)FF_QP2LAMBDA / 10.;\n    else\n        venc->quality = 0.03;\n    venc->quality *= venc->quality;\n    avccontext->extradata_size = put_main_header(venc, (uint8_t**)&avccontext->extradata);\n    avccontext->frame_size     = 1 << (venc->log2_blocksize[0] - 1);\n    avccontext->coded_frame            = avcodec_alloc_frame();\n    avccontext->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 = NULL;\n#if CONFIG_MEMALIGN_HACK\n    long diff;\n#endif\n    if(size > (INT_MAX-16) )\n        return NULL;\n#if 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 HAVE_POSIX_MEMALIGN\n    if (posix_memalign(&ptr,16,size))\n        ptr = NULL;\n#elif HAVE_MEMALIGN\n    ptr = memalign(16,size);\n#else\n    ptr = malloc(size);\n#endif\n    return ptr;\n}']