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

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

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

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

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

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

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

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

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

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

libavcodec/adpcm.c:201:5: 
199.     }
200. 
201.     avctx->coded_frame= avcodec_alloc_frame();
         ^
202.     avctx->coded_frame->key_frame= 1;
203. 

libavcodec/utils.c:393:1: start of procedure avcodec_alloc_frame()
  391. }
  392. 
  393. AVFrame *avcodec_alloc_frame(void){
       ^
  394.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  395. 

libavcodec/utils.c:394:5: 
  392. 
  393. AVFrame *avcodec_alloc_frame(void){
  394.     AVFrame *pic= av_malloc(sizeof(AVFrame));
           ^
  395. 
  396.     if(pic==NULL) return NULL;

libavutil/mem.c:43:1: start of procedure av_malloc()
    41.    linker will do it automatically */
    42. 
    43. void *av_malloc(unsigned int size)
        ^
    44. {
    45.     void *ptr = NULL;

libavutil/mem.c:45:5: 
    43. void *av_malloc(unsigned int size)
    44. {
    45.     void *ptr = NULL;
            ^
    46. #ifdef CONFIG_MEMALIGN_HACK
    47.     long diff;

libavutil/mem.c:51:8: Taking false branch
    49. 
    50.     /* let's disallow possible ambiguous cases */
    51.     if(size > (INT_MAX-16) )
               ^
    52.         return NULL;
    53. 

libavutil/mem.c:62:5: Skipping posix_memalign(): method has no implementation
    60.     ((char*)ptr)[-1]= diff;
    61. #elif defined (HAVE_POSIX_MEMALIGN)
    62.     posix_memalign(&ptr,16,size);
            ^
    63. #elif defined (HAVE_MEMALIGN)
    64.     ptr = memalign(16,size);

libavutil/mem.c:94:5: 
    92.     ptr = malloc(size);
    93. #endif
    94.     return ptr;
            ^
    95. }
    96. 

libavutil/mem.c:95:1: return from a call to av_malloc
    93. #endif
    94.     return ptr;
    95. }
        ^
    96. 
    97. void *av_realloc(void *ptr, unsigned int size)

libavcodec/utils.c:396:8: Taking true branch
  394.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  395. 
  396.     if(pic==NULL) return NULL;
              ^
  397. 
  398.     avcodec_get_frame_defaults(pic);

libavcodec/utils.c:396:19: 
  394.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  395. 
  396.     if(pic==NULL) return NULL;
                         ^
  397. 
  398.     avcodec_get_frame_defaults(pic);

libavcodec/utils.c:401:1: return from a call to avcodec_alloc_frame
  399. 
  400.     return pic;
  401. }
       ^
  402. 
  403. int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec)

libavcodec/adpcm.c:202:5: 
200. 
201.     avctx->coded_frame= avcodec_alloc_frame();
202.     avctx->coded_frame->key_frame= 1;
         ^
203. 
204.     return 0;

static 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;
        break;
    }
    avctx->coded_frame= avcodec_alloc_frame();
    avctx->coded_frame->key_frame= 1;
    return 0;
}
['static 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        break;\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#ifdef CONFIG_MEMALIGN_HACK\n    long diff;\n#endif\n    if(size > (INT_MAX-16) )\n        return NULL;\n#ifdef 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 defined (HAVE_POSIX_MEMALIGN)\n    posix_memalign(&ptr,16,size);\n#elif defined (HAVE_MEMALIGN)\n    ptr = memalign(16,size);\n#else\n    ptr = malloc(size);\n#endif\n    return ptr;\n}']