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

libavcodec/roqaudioenc.c:40:1: start of procedure roq_dpcm_encode_init()
38. } ROQDPCMContext;
39. 
40. static av_cold int roq_dpcm_encode_init(AVCodecContext *avctx)
    ^
41. {
42.     ROQDPCMContext *context = avctx->priv_data;

libavcodec/roqaudioenc.c:42:5: 
40. static av_cold int roq_dpcm_encode_init(AVCodecContext *avctx)
41. {
42.     ROQDPCMContext *context = avctx->priv_data;
        ^
43. 
44.     if (avctx->channels > 2) {

libavcodec/roqaudioenc.c:44:9: Taking false branch
42.     ROQDPCMContext *context = avctx->priv_data;
43. 
44.     if (avctx->channels > 2) {
            ^
45.         av_log(avctx, AV_LOG_ERROR, "Audio must be mono or stereo\n");
46.         return -1;

libavcodec/roqaudioenc.c:48:9: Taking false branch
46.         return -1;
47.     }
48.     if (avctx->sample_rate != 22050) {
            ^
49.         av_log(avctx, AV_LOG_ERROR, "Audio must be 22050 Hz\n");
50.         return -1;

libavcodec/roqaudioenc.c:52:9: Taking false branch
50.         return -1;
51.     }
52.     if (avctx->sample_fmt != AV_SAMPLE_FMT_S16) {
            ^
53.         av_log(avctx, AV_LOG_ERROR, "Audio must be signed 16-bit\n");
54.         return -1;

libavcodec/roqaudioenc.c:57:5: 
55.     }
56. 
57.     avctx->frame_size = ROQ_FIRST_FRAME_SIZE;
        ^
58. 
59.     context->lastSample[0] = context->lastSample[1] = 0;

libavcodec/roqaudioenc.c:59:5: 
57.     avctx->frame_size = ROQ_FIRST_FRAME_SIZE;
58. 
59.     context->lastSample[0] = context->lastSample[1] = 0;
        ^
60. 
61.     avctx->coded_frame= avcodec_alloc_frame();

libavcodec/roqaudioenc.c:61:5: 
59.     context->lastSample[0] = context->lastSample[1] = 0;
60. 
61.     avctx->coded_frame= avcodec_alloc_frame();
        ^
62.     avctx->coded_frame->key_frame= 1;
63. 

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/roqaudioenc.c:62:5: 
60. 
61.     avctx->coded_frame= avcodec_alloc_frame();
62.     avctx->coded_frame->key_frame= 1;
        ^
63. 
64.     return 0;

static av_cold int roq_dpcm_encode_init(AVCodecContext *avctx)
{
    ROQDPCMContext *context = avctx->priv_data;
    if (avctx->channels > 2) {
        av_log(avctx, AV_LOG_ERROR, "Audio must be mono or stereo\n");
        return -1;
    }
    if (avctx->sample_rate != 22050) {
        av_log(avctx, AV_LOG_ERROR, "Audio must be 22050 Hz\n");
        return -1;
    }
    if (avctx->sample_fmt != AV_SAMPLE_FMT_S16) {
        av_log(avctx, AV_LOG_ERROR, "Audio must be signed 16-bit\n");
        return -1;
    }
    avctx->frame_size = ROQ_FIRST_FRAME_SIZE;
    context->lastSample[0] = context->lastSample[1] = 0;
    avctx->coded_frame= avcodec_alloc_frame();
    avctx->coded_frame->key_frame= 1;
    return 0;
}
['static av_cold int roq_dpcm_encode_init(AVCodecContext *avctx)\n{\n    ROQDPCMContext *context = avctx->priv_data;\n    if (avctx->channels > 2) {\n        av_log(avctx, AV_LOG_ERROR, "Audio must be mono or stereo\\n");\n        return -1;\n    }\n    if (avctx->sample_rate != 22050) {\n        av_log(avctx, AV_LOG_ERROR, "Audio must be 22050 Hz\\n");\n        return -1;\n    }\n    if (avctx->sample_fmt != AV_SAMPLE_FMT_S16) {\n        av_log(avctx, AV_LOG_ERROR, "Audio must be signed 16-bit\\n");\n        return -1;\n    }\n    avctx->frame_size = ROQ_FIRST_FRAME_SIZE;\n    context->lastSample[0] = context->lastSample[1] = 0;\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(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}']