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

libavcodec/roqaudioenc.c:52:1: start of procedure roq_dpcm_encode_init()
50. }
51. 
52. static av_cold int roq_dpcm_encode_init(AVCodecContext *avctx)
    ^
53. {
54.     ROQDPCMContext *context = avctx->priv_data;

libavcodec/roqaudioenc.c:54:5: 
52. static av_cold int roq_dpcm_encode_init(AVCodecContext *avctx)
53. {
54.     ROQDPCMContext *context = avctx->priv_data;
        ^
55. 
56.     if (avctx->channels > 2) {

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

libavcodec/roqaudioenc.c:60:9: Taking false branch
58.         return -1;
59.     }
60.     if (avctx->sample_rate != 22050) {
            ^
61.         av_log(avctx, AV_LOG_ERROR, "Audio must be 22050 Hz\n");
62.         return -1;

libavcodec/roqaudioenc.c:64:9: Taking false branch
62.         return -1;
63.     }
64.     if (avctx->sample_fmt != SAMPLE_FMT_S16) {
            ^
65.         av_log(avctx, AV_LOG_ERROR, "Audio must be signed 16-bit\n");
66.         return -1;

libavcodec/roqaudioenc.c:69:5: 
67.     }
68. 
69.     roq_dpcm_table_init();
        ^
70. 
71.     avctx->frame_size = ROQ_FIRST_FRAME_SIZE;

libavcodec/roqaudioenc.c:40:1: start of procedure roq_dpcm_table_init()
  38. } ROQDPCMContext;
  39. 
  40. static av_cold void roq_dpcm_table_init(void)
      ^
  41. {
  42.     int i;

libavcodec/roqaudioenc.c:45:10: 
  43. 
  44.     /* Create a table of quick DPCM values */
  45.     for (i=0; i<MAX_DPCM; i++) {
               ^
  46.         int s= ff_sqrt(i);
  47.         int mid= s*s + s;

libavcodec/roqaudioenc.c:45:15: Loop condition is true. Entering loop body
  43. 
  44.     /* Create a table of quick DPCM values */
  45.     for (i=0; i<MAX_DPCM; i++) {
                    ^
  46.         int s= ff_sqrt(i);
  47.         int mid= s*s + s;

libavcodec/roqaudioenc.c:46:9: 
  44.     /* Create a table of quick DPCM values */
  45.     for (i=0; i<MAX_DPCM; i++) {
  46.         int s= ff_sqrt(i);
              ^
  47.         int mid= s*s + s;
  48.         dpcmValues[i]= s + (i>mid);

libavutil/internal.h:167:1: start of procedure ff_sqrt()
    165. extern const uint8_t ff_sqrt_tab[256];
    166. 
    167. static inline av_const unsigned int ff_sqrt(unsigned int a)
         ^
    168. {
    169.     unsigned int b;

libavutil/internal.h:171:9: Taking true branch
    169.     unsigned int b;
    170. 
    171.     if (a < 255) return (ff_sqrt_tab[a + 1] - 1) >> 4;
                 ^
    172.     else if (a < (1 << 12)) b = ff_sqrt_tab[a >> 4] >> 2;
    173. #if !CONFIG_SMALL

libavutil/internal.h:171:18: 
    169.     unsigned int b;
    170. 
    171.     if (a < 255) return (ff_sqrt_tab[a + 1] - 1) >> 4;
                          ^
    172.     else if (a < (1 << 12)) b = ff_sqrt_tab[a >> 4] >> 2;
    173. #if !CONFIG_SMALL

libavutil/internal.h:185:1: return from a call to ff_sqrt
    183. 
    184.     return b - (a < b * b);
    185. }
         ^
    186. 
    187. #if ARCH_X86

libavcodec/roqaudioenc.c:47:9: 
  45.     for (i=0; i<MAX_DPCM; i++) {
  46.         int s= ff_sqrt(i);
  47.         int mid= s*s + s;
              ^
  48.         dpcmValues[i]= s + (i>mid);
  49.     }

libavcodec/roqaudioenc.c:48:29: Condition is true
  46.         int s= ff_sqrt(i);
  47.         int mid= s*s + s;
  48.         dpcmValues[i]= s + (i>mid);
                                  ^
  49.     }
  50. }

libavcodec/roqaudioenc.c:48:9: 
  46.         int s= ff_sqrt(i);
  47.         int mid= s*s + s;
  48.         dpcmValues[i]= s + (i>mid);
              ^
  49.     }
  50. }

libavcodec/roqaudioenc.c:45:27: 
  43. 
  44.     /* Create a table of quick DPCM values */
  45.     for (i=0; i<MAX_DPCM; i++) {
                                ^
  46.         int s= ff_sqrt(i);
  47.         int mid= s*s + s;

libavcodec/roqaudioenc.c:45:15: Loop condition is false. Leaving loop
  43. 
  44.     /* Create a table of quick DPCM values */
  45.     for (i=0; i<MAX_DPCM; i++) {
                    ^
  46.         int s= ff_sqrt(i);
  47.         int mid= s*s + s;

libavcodec/roqaudioenc.c:50:1: return from a call to roq_dpcm_table_init
  48.         dpcmValues[i]= s + (i>mid);
  49.     }
  50. }
      ^
  51. 
  52. static av_cold int roq_dpcm_encode_init(AVCodecContext *avctx)

libavcodec/roqaudioenc.c:71:5: 
69.     roq_dpcm_table_init();
70. 
71.     avctx->frame_size = ROQ_FIRST_FRAME_SIZE;
        ^
72. 
73.     context->lastSample[0] = context->lastSample[1] = 0;

libavcodec/roqaudioenc.c:73:5: 
71.     avctx->frame_size = ROQ_FIRST_FRAME_SIZE;
72. 
73.     context->lastSample[0] = context->lastSample[1] = 0;
        ^
74. 
75.     avctx->coded_frame= avcodec_alloc_frame();

libavcodec/roqaudioenc.c:75:5: 
73.     context->lastSample[0] = context->lastSample[1] = 0;
74. 
75.     avctx->coded_frame= avcodec_alloc_frame();
        ^
76.     avctx->coded_frame->key_frame= 1;
77. 

libavcodec/utils.c:430:1: start of procedure avcodec_alloc_frame()
  428. }
  429. 
  430. AVFrame *avcodec_alloc_frame(void){
       ^
  431.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  432. 

libavcodec/utils.c:431:5: 
  429. 
  430. AVFrame *avcodec_alloc_frame(void){
  431.     AVFrame *pic= av_malloc(sizeof(AVFrame));
           ^
  432. 
  433.     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:433:8: Taking true branch
  431.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  432. 
  433.     if(pic==NULL) return NULL;
              ^
  434. 
  435.     avcodec_get_frame_defaults(pic);

libavcodec/utils.c:433:19: 
  431.     AVFrame *pic= av_malloc(sizeof(AVFrame));
  432. 
  433.     if(pic==NULL) return NULL;
                         ^
  434. 
  435.     avcodec_get_frame_defaults(pic);

libavcodec/utils.c:438:1: return from a call to avcodec_alloc_frame
  436. 
  437.     return pic;
  438. }
       ^
  439. 
  440. int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec)

libavcodec/roqaudioenc.c:76:5: 
74. 
75.     avctx->coded_frame= avcodec_alloc_frame();
76.     avctx->coded_frame->key_frame= 1;
        ^
77. 
78.     return 0;
