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

libavcodec/adpcm.c:155:1: start of procedure adpcm_encode_init()
153. 
154. #if CONFIG_ENCODERS
155. static av_cold int adpcm_encode_init(AVCodecContext *avctx)
     ^
156. {
157.     if (avctx->channels > 2)

libavcodec/adpcm.c:157:9: Taking false branch
155. static av_cold int adpcm_encode_init(AVCodecContext *avctx)
156. {
157.     if (avctx->channels > 2)
             ^
158.         return -1; /* only stereo or mono =) */
159. 

libavcodec/adpcm.c:160:8: Taking true branch
158.         return -1; /* only stereo or mono =) */
159. 
160.     if(avctx->trellis && (unsigned)avctx->trellis > 16U){
            ^
161.         av_log(avctx, AV_LOG_ERROR, "invalid trellis size\n");
162.         return -1;

libavcodec/adpcm.c:160:26: Taking false branch
158.         return -1; /* only stereo or mono =) */
159. 
160.     if(avctx->trellis && (unsigned)avctx->trellis > 16U){
                              ^
161.         av_log(avctx, AV_LOG_ERROR, "invalid trellis size\n");
162.         return -1;

libavcodec/adpcm.c:165:5: 
163.     }
164. 
165.     switch(avctx->codec->id) {
         ^
166.     case CODEC_ID_ADPCM_IMA_WAV:
167.         avctx->frame_size = (BLKSIZE - 4 * avctx->channels) * 8 / (4 * avctx->channels) + 1; /* each 16 bits sample gives one nibble */

libavcodec/adpcm.c:166:5: Switch condition is false. Skipping switch case
164. 
165.     switch(avctx->codec->id) {
166.     case CODEC_ID_ADPCM_IMA_WAV:
         ^
167.         avctx->frame_size = (BLKSIZE - 4 * avctx->channels) * 8 / (4 * avctx->channels) + 1; /* each 16 bits sample gives one nibble */
168.                                                              /* and we have 4 bytes per channel overhead */

libavcodec/adpcm.c:172:5: Switch condition is true. Entering switch case
170.         /* seems frame_size isn't taken into account... have to buffer the samples :-( */
171.         break;
172.     case CODEC_ID_ADPCM_IMA_QT:
         ^
173.         avctx->frame_size = 64;
174.         avctx->block_align = 34 * avctx->channels;

libavcodec/adpcm.c:173:9: 
171.         break;
172.     case CODEC_ID_ADPCM_IMA_QT:
173.         avctx->frame_size = 64;
             ^
174.         avctx->block_align = 34 * avctx->channels;
175.         break;

libavcodec/adpcm.c:174:9: 
172.     case CODEC_ID_ADPCM_IMA_QT:
173.         avctx->frame_size = 64;
174.         avctx->block_align = 34 * avctx->channels;
             ^
175.         break;
176.     case CODEC_ID_ADPCM_MS:

libavcodec/adpcm.c:198:5: 
196.     }
197. 
198.     avctx->coded_frame= avcodec_alloc_frame();
         ^
199.     avctx->coded_frame->key_frame= 1;
200. 

libavcodec/utils.c:440:1: start of procedure avcodec_alloc_frame()
  438. }
  439. 
  440. AVFrame *avcodec_alloc_frame(void){
       ^
  441.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  442. 

libavcodec/utils.c:441:5: 
  439. 
  440. AVFrame *avcodec_alloc_frame(void){
  441.     AVFrame *pic= av_malloc(sizeof(AVFrame));
           ^
  442. 
  443.     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:443:8: Taking true branch
  441.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  442. 
  443.     if(pic==NULL) return NULL;
              ^
  444. 
  445.     avcodec_get_frame_defaults(pic);

libavcodec/utils.c:443:19: 
  441.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  442. 
  443.     if(pic==NULL) return NULL;
                         ^
  444. 
  445.     avcodec_get_frame_defaults(pic);

libavcodec/utils.c:448:1: return from a call to avcodec_alloc_frame
  446. 
  447.     return pic;
  448. }
       ^
  449. 
  450. int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec)

libavcodec/adpcm.c:199:5: 
197. 
198.     avctx->coded_frame= avcodec_alloc_frame();
199.     avctx->coded_frame->key_frame= 1;
         ^
200. 
201.     return 0;

static av_cold int adpcm_encode_init(AVCodecContext *avctx)
{
    if (avctx->channels > 2)
        return -1;
    if(avctx->trellis && (unsigned)avctx->trellis > 16U){
        av_log(avctx, AV_LOG_ERROR, "invalid trellis size\n");
        return -1;
    }
    switch(avctx->codec->id) {
    case CODEC_ID_ADPCM_IMA_WAV:
        avctx->frame_size = (BLKSIZE - 4 * avctx->channels) * 8 / (4 * avctx->channels) + 1;
        avctx->block_align = BLKSIZE;
        break;
    case CODEC_ID_ADPCM_IMA_QT:
        avctx->frame_size = 64;
        avctx->block_align = 34 * avctx->channels;
        break;
    case CODEC_ID_ADPCM_MS:
        avctx->frame_size = (BLKSIZE - 7 * avctx->channels) * 2 / avctx->channels + 2;
        avctx->block_align = BLKSIZE;
        break;
    case CODEC_ID_ADPCM_YAMAHA:
        avctx->frame_size = BLKSIZE * avctx->channels;
        avctx->block_align = BLKSIZE;
        break;
    case CODEC_ID_ADPCM_SWF:
        if (avctx->sample_rate != 11025 &&
            avctx->sample_rate != 22050 &&
            avctx->sample_rate != 44100) {
            av_log(avctx, AV_LOG_ERROR, "Sample rate must be 11025, 22050 or 44100\n");
            return -1;
        }
        avctx->frame_size = 512 * (avctx->sample_rate / 11025);
        break;
    default:
        return -1;
    }
    avctx->coded_frame= avcodec_alloc_frame();
    avctx->coded_frame->key_frame= 1;
    return 0;
}
['static av_cold int adpcm_encode_init(AVCodecContext *avctx)\n{\n    if (avctx->channels > 2)\n        return -1;\n    if(avctx->trellis && (unsigned)avctx->trellis > 16U){\n        av_log(avctx, AV_LOG_ERROR, "invalid trellis size\\n");\n        return -1;\n    }\n    switch(avctx->codec->id) {\n    case CODEC_ID_ADPCM_IMA_WAV:\n        avctx->frame_size = (BLKSIZE - 4 * avctx->channels) * 8 / (4 * avctx->channels) + 1;\n        avctx->block_align = BLKSIZE;\n        break;\n    case CODEC_ID_ADPCM_IMA_QT:\n        avctx->frame_size = 64;\n        avctx->block_align = 34 * avctx->channels;\n        break;\n    case CODEC_ID_ADPCM_MS:\n        avctx->frame_size = (BLKSIZE - 7 * avctx->channels) * 2 / avctx->channels + 2;\n        avctx->block_align = BLKSIZE;\n        break;\n    case CODEC_ID_ADPCM_YAMAHA:\n        avctx->frame_size = BLKSIZE * avctx->channels;\n        avctx->block_align = BLKSIZE;\n        break;\n    case CODEC_ID_ADPCM_SWF:\n        if (avctx->sample_rate != 11025 &&\n            avctx->sample_rate != 22050 &&\n            avctx->sample_rate != 44100) {\n            av_log(avctx, AV_LOG_ERROR, "Sample rate must be 11025, 22050 or 44100\\n");\n            return -1;\n        }\n        avctx->frame_size = 512 * (avctx->sample_rate / 11025);\n        break;\n    default:\n        return -1;\n    }\n    avctx->coded_frame= avcodec_alloc_frame();\n    avctx->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}']