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

ffmpeg.c:3683:1: start of procedure opt_output_file()
3681. }
3682. 
3683. static void opt_output_file(const char *filename)
      ^
3684. {
3685.     AVFormatContext *oc;

ffmpeg.c:3688:5: 
3686.     int err, use_video, use_audio, use_subtitle;
3687.     int input_has_video, input_has_audio, input_has_subtitle;
3688.     AVFormatParameters params, *ap = &params;
          ^
3689.     AVOutputFormat *file_oformat;
3690.     AVMetadataTag *tag = NULL;

ffmpeg.c:3690:5: 
3688.     AVFormatParameters params, *ap = &params;
3689.     AVOutputFormat *file_oformat;
3690.     AVMetadataTag *tag = NULL;
          ^
3691. 
3692.     if (!strcmp(filename, "-"))

ffmpeg.c:3692:10: Taking false branch
3690.     AVMetadataTag *tag = NULL;
3691. 
3692.     if (!strcmp(filename, "-"))
               ^
3693.         filename = "pipe:";
3694. 

ffmpeg.c:3695:5: 
3693.         filename = "pipe:";
3694. 
3695.     oc = avformat_alloc_context();
          ^
3696.     if (!oc) {
3697.         print_error(filename, AVERROR(ENOMEM));

libavformat/options.c:82:1: start of procedure avformat_alloc_context()
  80. }
  81. 
  82. AVFormatContext *avformat_alloc_context(void)
      ^
  83. {
  84.     AVFormatContext *ic;

libavformat/options.c:85:5: 
  83. {
  84.     AVFormatContext *ic;
  85.     ic = av_malloc(sizeof(AVFormatContext));
          ^
  86.     if (!ic) return ic;
  87.     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(FF_INTERNAL_MEM_TYPE size)
        ^
    65. {
    66.     void *ptr = NULL;

libavutil/mem.c:66:5: 
    64. void *av_malloc(FF_INTERNAL_MEM_TYPE 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, FF_INTERNAL_MEM_TYPE size)

libavformat/options.c:86:10: Taking true branch
  84.     AVFormatContext *ic;
  85.     ic = av_malloc(sizeof(AVFormatContext));
  86.     if (!ic) return ic;
               ^
  87.     avformat_get_context_defaults(ic);
  88.     ic->av_class = &av_format_context_class;

libavformat/options.c:86:14: 
  84.     AVFormatContext *ic;
  85.     ic = av_malloc(sizeof(AVFormatContext));
  86.     if (!ic) return ic;
                   ^
  87.     avformat_get_context_defaults(ic);
  88.     ic->av_class = &av_format_context_class;

libavformat/options.c:90:1: return from a call to avformat_alloc_context
  88.     ic->av_class = &av_format_context_class;
  89.     return ic;
  90. }
      ^
  91. 
  92. #if FF_API_ALLOC_FORMAT_CONTEXT

ffmpeg.c:3696:10: Taking true branch
3694. 
3695.     oc = avformat_alloc_context();
3696.     if (!oc) {
               ^
3697.         print_error(filename, AVERROR(ENOMEM));
3698.         ffmpeg_exit(1);

ffmpeg.c:3697:9: 
3695.     oc = avformat_alloc_context();
3696.     if (!oc) {
3697.         print_error(filename, AVERROR(ENOMEM));
              ^
3698.         ffmpeg_exit(1);
3699.     }

cmdutils.c:342:1: start of procedure print_error()
  340. }
  341. 
  342. void print_error(const char *filename, int err)
       ^
  343. {
  344.     char errbuf[128];

cmdutils.c:345:5: 
  343. {
  344.     char errbuf[128];
  345.     const char *errbuf_ptr = errbuf;
           ^
  346. 
  347.     if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)

cmdutils.c:347:9: Taking true branch
  345.     const char *errbuf_ptr = errbuf;
  346. 
  347.     if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
               ^
  348.         errbuf_ptr = strerror(AVUNERROR(err));
  349.     fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);

cmdutils.c:348:9: Skipping strerror(): method has no implementation
  346. 
  347.     if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
  348.         errbuf_ptr = strerror(AVUNERROR(err));
               ^
  349.     fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);
  350. }

cmdutils.c:349:5: 
  347.     if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
  348.         errbuf_ptr = strerror(AVUNERROR(err));
  349.     fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);
           ^
  350. }
  351. 

cmdutils.c:350:1: return from a call to print_error
  348.         errbuf_ptr = strerror(AVUNERROR(err));
  349.     fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);
  350. }
       ^
  351. 
  352. static int warned_cfg = 0;

ffmpeg.c:3698:9: Skipping ffmpeg_exit(): empty list of specs
3696.     if (!oc) {
3697.         print_error(filename, AVERROR(ENOMEM));
3698.         ffmpeg_exit(1);
              ^
3699.     }
3700. 

ffmpeg.c:3701:9: Taking true branch
3699.     }
3700. 
3701.     if (last_asked_format) {
              ^
3702.         file_oformat = av_guess_format(last_asked_format, NULL, NULL);
3703.         if (!file_oformat) {

ffmpeg.c:3702:9: Skipping av_guess_format(): empty list of specs
3700. 
3701.     if (last_asked_format) {
3702.         file_oformat = av_guess_format(last_asked_format, NULL, NULL);
              ^
3703.         if (!file_oformat) {
3704.             fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);

ffmpeg.c:3703:14: Taking false branch
3701.     if (last_asked_format) {
3702.         file_oformat = av_guess_format(last_asked_format, NULL, NULL);
3703.         if (!file_oformat) {
                   ^
3704.             fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);
3705.             ffmpeg_exit(1);

ffmpeg.c:3707:9: 
3705.             ffmpeg_exit(1);
3706.         }
3707.         last_asked_format = NULL;
              ^
3708.     } else {
3709.         file_oformat = av_guess_format(NULL, filename, NULL);

ffmpeg.c:3717:5: 
3715.     }
3716. 
3717.     oc->oformat = file_oformat;
          ^
3718.     av_strlcpy(oc->filename, filename, sizeof(oc->filename));
3719. 
