avconv.c:3521: error: Null Dereference
  pointer `ic` last assigned on line 3519 could be null and is dereferenced at line 3521, column 5.

avconv.c:3516:1: start of procedure read_avserver_streams()
3514. }
3515. 
3516. static int read_avserver_streams(OptionsContext *o, AVFormatContext *s, const char *filename)
      ^
3517. {
3518.     int i, err;

avconv.c:3519:5: 
3517. {
3518.     int i, err;
3519.     AVFormatContext *ic = avformat_alloc_context();
          ^
3520. 
3521.     ic->interrupt_callback = int_cb;

libavformat/options.c:141:1: start of procedure avformat_alloc_context()
  139. }
  140. 
  141. AVFormatContext *avformat_alloc_context(void)
       ^
  142. {
  143.     AVFormatContext *ic;

libavformat/options.c:144:5: 
  142. {
  143.     AVFormatContext *ic;
  144.     ic = av_malloc(sizeof(AVFormatContext));
           ^
  145.     if (!ic) return ic;
  146.     avformat_get_context_defaults(ic);

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)

libavformat/options.c:145:10: Taking true branch
  143.     AVFormatContext *ic;
  144.     ic = av_malloc(sizeof(AVFormatContext));
  145.     if (!ic) return ic;
                ^
  146.     avformat_get_context_defaults(ic);
  147.     return ic;

libavformat/options.c:145:14: 
  143.     AVFormatContext *ic;
  144.     ic = av_malloc(sizeof(AVFormatContext));
  145.     if (!ic) return ic;
                    ^
  146.     avformat_get_context_defaults(ic);
  147.     return ic;

libavformat/options.c:148:1: return from a call to avformat_alloc_context
  146.     avformat_get_context_defaults(ic);
  147.     return ic;
  148. }
       ^
  149. 
  150. const AVClass *avformat_get_class(void)

avconv.c:3521:5: 
3519.     AVFormatContext *ic = avformat_alloc_context();
3520. 
3521.     ic->interrupt_callback = int_cb;
          ^
3522.     err = avformat_open_input(&ic, filename, NULL, NULL);
3523.     if (err < 0)

static int read_avserver_streams(OptionsContext *o, AVFormatContext *s, const char *filename)
{
    int i, err;
    AVFormatContext *ic = avformat_alloc_context();
    ic->interrupt_callback = int_cb;
    err = avformat_open_input(&ic, filename, NULL, NULL);
    if (err < 0)
        return err;
    for(i=0;i<ic->nb_streams;i++) {
        AVStream *st;
        OutputStream *ost;
        AVCodec *codec;
        codec = avcodec_find_encoder(ic->streams[i]->codec->codec_id);
        ost   = new_output_stream(o, s, codec->type);
        st    = ost->st;
        memcpy(st, ic->streams[i], sizeof(AVStream));
        st->info = NULL;
        avcodec_copy_context(st->codec, ic->streams[i]->codec);
        if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && !ost->stream_copy)
            choose_sample_fmt(st, codec);
        else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && !ost->stream_copy)
            choose_pixel_fmt(st, codec);
    }
    av_close_input_file(ic);
    return 0;
}
['static int read_avserver_streams(OptionsContext *o, AVFormatContext *s, const char *filename)\n{\n    int i, err;\n    AVFormatContext *ic = avformat_alloc_context();\n    ic->interrupt_callback = int_cb;\n    err = avformat_open_input(&ic, filename, NULL, NULL);\n    if (err < 0)\n        return err;\n    for(i=0;i<ic->nb_streams;i++) {\n        AVStream *st;\n        OutputStream *ost;\n        AVCodec *codec;\n        codec = avcodec_find_encoder(ic->streams[i]->codec->codec_id);\n        ost   = new_output_stream(o, s, codec->type);\n        st    = ost->st;\n        memcpy(st, ic->streams[i], sizeof(AVStream));\n        st->info = NULL;\n        avcodec_copy_context(st->codec, ic->streams[i]->codec);\n        if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && !ost->stream_copy)\n            choose_sample_fmt(st, codec);\n        else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && !ost->stream_copy)\n            choose_pixel_fmt(st, codec);\n    }\n    av_close_input_file(ic);\n    return 0;\n}', 'AVFormatContext *avformat_alloc_context(void)\n{\n    AVFormatContext *ic;\n    ic = av_malloc(sizeof(AVFormatContext));\n    if (!ic) return ic;\n    avformat_get_context_defaults(ic);\n    return ic;\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}']