ffmpeg.c:3675: error: Null Dereference
  pointer `oc` last assigned on line 3653 could be null and is dereferenced at line 3675, column 5.

ffmpeg.c:3642:1: start of procedure opt_output_file()
3640. }
3641. 
3642. static void opt_output_file(const char *filename)
      ^
3643. {
3644.     AVFormatContext *oc;

ffmpeg.c:3647:5: 
3645.     int err, use_video, use_audio, use_subtitle;
3646.     int input_has_video, input_has_audio, input_has_subtitle;
3647.     AVFormatParameters params, *ap = &params;
          ^
3648.     AVOutputFormat *file_oformat;
3649. 

ffmpeg.c:3650:10: Taking false branch
3648.     AVOutputFormat *file_oformat;
3649. 
3650.     if (!strcmp(filename, "-"))
               ^
3651.         filename = "pipe:";
3652. 

ffmpeg.c:3653:5: 
3651.         filename = "pipe:";
3652. 
3653.     oc = avformat_alloc_context();
          ^
3654.     if (!oc) {
3655.         print_error(filename, AVERROR(ENOMEM));

libavformat/options.c:78:1: start of procedure avformat_alloc_context()
  76. }
  77. 
  78. AVFormatContext *avformat_alloc_context(void)
      ^
  79. {
  80.     AVFormatContext *ic;

libavformat/options.c:81:5: 
  79. {
  80.     AVFormatContext *ic;
  81.     ic = av_malloc(sizeof(AVFormatContext));
          ^
  82.     if (!ic) return ic;
  83.     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-16) )
               ^
    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,16,size))
                ^
    84.         ptr = NULL;
    85. #elif HAVE_MEMALIGN

libavutil/mem.c:116:5: 
    114.     ptr = malloc(size);
    115. #endif
    116.     return ptr;
             ^
    117. }
    118. 

libavutil/mem.c:117:1: return from a call to av_malloc
    115. #endif
    116.     return ptr;
    117. }
         ^
    118. 
    119. void *av_realloc(void *ptr, size_t size)

libavformat/options.c:82:10: Taking true branch
  80.     AVFormatContext *ic;
  81.     ic = av_malloc(sizeof(AVFormatContext));
  82.     if (!ic) return ic;
               ^
  83.     avformat_get_context_defaults(ic);
  84.     ic->av_class = &av_format_context_class;

libavformat/options.c:82:14: 
  80.     AVFormatContext *ic;
  81.     ic = av_malloc(sizeof(AVFormatContext));
  82.     if (!ic) return ic;
                   ^
  83.     avformat_get_context_defaults(ic);
  84.     ic->av_class = &av_format_context_class;

libavformat/options.c:86:1: return from a call to avformat_alloc_context
  84.     ic->av_class = &av_format_context_class;
  85.     return ic;
  86. }
      ^

ffmpeg.c:3654:10: Taking true branch
3652. 
3653.     oc = avformat_alloc_context();
3654.     if (!oc) {
               ^
3655.         print_error(filename, AVERROR(ENOMEM));
3656.         ffmpeg_exit(1);

ffmpeg.c:3655:9: 
3653.     oc = avformat_alloc_context();
3654.     if (!oc) {
3655.         print_error(filename, AVERROR(ENOMEM));
              ^
3656.         ffmpeg_exit(1);
3657.     }

cmdutils.c:370:1: start of procedure print_error()
  368. }
  369. 
  370. void print_error(const char *filename, int err)
       ^
  371. {
  372.     char errbuf[128];

cmdutils.c:373:5: 
  371. {
  372.     char errbuf[128];
  373.     const char *errbuf_ptr = errbuf;
           ^
  374. 
  375.     if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)

cmdutils.c:375:9: Taking true branch
  373.     const char *errbuf_ptr = errbuf;
  374. 
  375.     if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
               ^
  376.         errbuf_ptr = strerror(AVUNERROR(err));
  377.     fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);

cmdutils.c:376:9: Skipping strerror(): method has no implementation
  374. 
  375.     if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
  376.         errbuf_ptr = strerror(AVUNERROR(err));
               ^
  377.     fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);
  378. }

cmdutils.c:377:5: 
  375.     if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
  376.         errbuf_ptr = strerror(AVUNERROR(err));
  377.     fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);
           ^
  378. }
  379. 

cmdutils.c:378:1: return from a call to print_error
  376.         errbuf_ptr = strerror(AVUNERROR(err));
  377.     fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);
  378. }
       ^
  379. 
  380. static int warned_cfg = 0;

ffmpeg.c:3656:9: Skipping ffmpeg_exit(): empty list of specs
3654.     if (!oc) {
3655.         print_error(filename, AVERROR(ENOMEM));
3656.         ffmpeg_exit(1);
              ^
3657.     }
3658. 

ffmpeg.c:3659:9: Taking true branch
3657.     }
3658. 
3659.     if (last_asked_format) {
              ^
3660.         file_oformat = av_guess_format(last_asked_format, NULL, NULL);
3661.         if (!file_oformat) {

ffmpeg.c:3660:9: Skipping av_guess_format(): empty list of specs
3658. 
3659.     if (last_asked_format) {
3660.         file_oformat = av_guess_format(last_asked_format, NULL, NULL);
              ^
3661.         if (!file_oformat) {
3662.             fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);

ffmpeg.c:3661:14: Taking false branch
3659.     if (last_asked_format) {
3660.         file_oformat = av_guess_format(last_asked_format, NULL, NULL);
3661.         if (!file_oformat) {
                   ^
3662.             fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);
3663.             ffmpeg_exit(1);

ffmpeg.c:3665:9: 
3663.             ffmpeg_exit(1);
3664.         }
3665.         last_asked_format = NULL;
              ^
3666.     } else {
3667.         file_oformat = av_guess_format(NULL, filename, NULL);

ffmpeg.c:3675:5: 
3673.     }
3674. 
3675.     oc->oformat = file_oformat;
          ^
3676.     av_strlcpy(oc->filename, filename, sizeof(oc->filename));
3677. 
