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

libavcodec/adxenc.c:115:1: start of procedure adx_encode_init()
113. }
114. 
115. static av_cold int adx_encode_init(AVCodecContext *avctx)
     ^
116. {
117.     if (avctx->channels > 2)

libavcodec/adxenc.c:117:9: Taking false branch
115. static av_cold int adx_encode_init(AVCodecContext *avctx)
116. {
117.     if (avctx->channels > 2)
             ^
118.         return -1; /* only stereo or mono =) */
119.     avctx->frame_size = 32;

libavcodec/adxenc.c:119:5: 
117.     if (avctx->channels > 2)
118.         return -1; /* only stereo or mono =) */
119.     avctx->frame_size = 32;
         ^
120. 
121.     avctx->coded_frame= avcodec_alloc_frame();

libavcodec/adxenc.c:121:5: 
119.     avctx->frame_size = 32;
120. 
121.     avctx->coded_frame= avcodec_alloc_frame();
         ^
122.     avctx->coded_frame->key_frame= 1;
123. 

libavcodec/utils.c:409:1: start of procedure avcodec_alloc_frame()
  407. }
  408. 
  409. AVFrame *avcodec_alloc_frame(void){
       ^
  410.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  411. 

libavcodec/utils.c:410:5: 
  408. 
  409. AVFrame *avcodec_alloc_frame(void){
  410.     AVFrame *pic= av_malloc(sizeof(AVFrame));
           ^
  411. 
  412.     if(pic==NULL) return NULL;

libavutil/mem.c:47:1: start of procedure av_malloc()
    45.    linker will do it automatically. */
    46. 
    47. void *av_malloc(unsigned int size)
        ^
    48. {
    49.     void *ptr = NULL;

libavutil/mem.c:49:5: 
    47. void *av_malloc(unsigned int size)
    48. {
    49.     void *ptr = NULL;
            ^
    50. #if CONFIG_MEMALIGN_HACK
    51.     long diff;

libavutil/mem.c:55:8: Taking false branch
    53. 
    54.     /* let's disallow possible ambiguous cases */
    55.     if(size > (INT_MAX-16) )
               ^
    56.         return NULL;
    57. 

libavutil/mem.c:66:9: Taking false branch
    64.     ((char*)ptr)[-1]= diff;
    65. #elif HAVE_POSIX_MEMALIGN
    66.     if (posix_memalign(&ptr,16,size))
                ^
    67.         ptr = NULL;
    68. #elif HAVE_MEMALIGN

libavutil/mem.c:99:5: 
     97.     ptr = malloc(size);
     98. #endif
     99.     return ptr;
             ^
    100. }
    101. 

libavutil/mem.c:100:1: return from a call to av_malloc
     98. #endif
     99.     return ptr;
    100. }
         ^
    101. 
    102. void *av_realloc(void *ptr, unsigned int size)

libavcodec/utils.c:412:8: Taking true branch
  410.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  411. 
  412.     if(pic==NULL) return NULL;
              ^
  413. 
  414.     avcodec_get_frame_defaults(pic);

libavcodec/utils.c:412:19: 
  410.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  411. 
  412.     if(pic==NULL) return NULL;
                         ^
  413. 
  414.     avcodec_get_frame_defaults(pic);

libavcodec/utils.c:417:1: return from a call to avcodec_alloc_frame
  415. 
  416.     return pic;
  417. }
       ^
  418. 
  419. int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec)

libavcodec/adxenc.c:122:5: 
120. 
121.     avctx->coded_frame= avcodec_alloc_frame();
122.     avctx->coded_frame->key_frame= 1;
         ^
123. 
124. //    avctx->bit_rate = avctx->sample_rate*avctx->channels*18*8/32;

static av_cold int adx_encode_init(AVCodecContext *avctx)
{
    if (avctx->channels > 2)
        return -1;
    avctx->frame_size = 32;
    avctx->coded_frame= avcodec_alloc_frame();
    avctx->coded_frame->key_frame= 1;
    av_log(avctx, AV_LOG_DEBUG, "adx encode init\n");
    return 0;
}
['static av_cold int adx_encode_init(AVCodecContext *avctx)\n{\n    if (avctx->channels > 2)\n        return -1;\n    avctx->frame_size = 32;\n    avctx->coded_frame= avcodec_alloc_frame();\n    avctx->coded_frame->key_frame= 1;\n    av_log(avctx, AV_LOG_DEBUG, "adx encode init\\n");\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}']