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

ffmpeg.c:3705:1: start of procedure opt_output_file()
3703. }
3704. 
3705. static void opt_output_file(const char *filename)
      ^
3706. {
3707.     AVFormatContext *oc;

ffmpeg.c:3710:5: 
3708.     int err, use_video, use_audio, use_subtitle, use_data;
3709.     int input_has_video, input_has_audio, input_has_subtitle, input_has_data;
3710.     AVFormatParameters params, *ap = &params;
          ^
3711.     AVOutputFormat *file_oformat;
3712. 

ffmpeg.c:3713:10: Taking false branch
3711.     AVOutputFormat *file_oformat;
3712. 
3713.     if (!strcmp(filename, "-"))
               ^
3714.         filename = "pipe:";
3715. 

ffmpeg.c:3716:5: 
3714.         filename = "pipe:";
3715. 
3716.     oc = avformat_alloc_context();
          ^
3717.     if (!oc) {
3718.         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-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: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:3717:10: Taking true branch
3715. 
3716.     oc = avformat_alloc_context();
3717.     if (!oc) {
               ^
3718.         print_error(filename, AVERROR(ENOMEM));
3719.         ffmpeg_exit(1);

ffmpeg.c:3718:9: 
3716.     oc = avformat_alloc_context();
3717.     if (!oc) {
3718.         print_error(filename, AVERROR(ENOMEM));
              ^
3719.         ffmpeg_exit(1);
3720.     }

cmdutils.c:437:1: start of procedure print_error()
  435. }
  436. 
  437. void print_error(const char *filename, int err)
       ^
  438. {
  439.     char errbuf[128];

cmdutils.c:440:5: 
  438. {
  439.     char errbuf[128];
  440.     const char *errbuf_ptr = errbuf;
           ^
  441. 
  442.     if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)

cmdutils.c:442:9: Taking true branch
  440.     const char *errbuf_ptr = errbuf;
  441. 
  442.     if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
               ^
  443.         errbuf_ptr = strerror(AVUNERROR(err));
  444.     fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);

cmdutils.c:443:9: Skipping strerror(): method has no implementation
  441. 
  442.     if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
  443.         errbuf_ptr = strerror(AVUNERROR(err));
               ^
  444.     fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);
  445. }

cmdutils.c:444:5: 
  442.     if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
  443.         errbuf_ptr = strerror(AVUNERROR(err));
  444.     fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);
           ^
  445. }
  446. 

cmdutils.c:445:1: return from a call to print_error
  443.         errbuf_ptr = strerror(AVUNERROR(err));
  444.     fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);
  445. }
       ^
  446. 
  447. static int warned_cfg = 0;

ffmpeg.c:3719:9: Skipping ffmpeg_exit(): empty list of specs
3717.     if (!oc) {
3718.         print_error(filename, AVERROR(ENOMEM));
3719.         ffmpeg_exit(1);
              ^
3720.     }
3721. 

ffmpeg.c:3722:9: Taking true branch
3720.     }
3721. 
3722.     if (last_asked_format) {
              ^
3723.         file_oformat = av_guess_format(last_asked_format, NULL, NULL);
3724.         if (!file_oformat) {

ffmpeg.c:3723:9: Skipping av_guess_format(): empty list of specs
3721. 
3722.     if (last_asked_format) {
3723.         file_oformat = av_guess_format(last_asked_format, NULL, NULL);
              ^
3724.         if (!file_oformat) {
3725.             fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);

ffmpeg.c:3724:14: Taking false branch
3722.     if (last_asked_format) {
3723.         file_oformat = av_guess_format(last_asked_format, NULL, NULL);
3724.         if (!file_oformat) {
                   ^
3725.             fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);
3726.             ffmpeg_exit(1);

ffmpeg.c:3728:9: 
3726.             ffmpeg_exit(1);
3727.         }
3728.         last_asked_format = NULL;
              ^
3729.     } else {
3730.         file_oformat = av_guess_format(NULL, filename, NULL);

ffmpeg.c:3738:5: 
3736.     }
3737. 
3738.     oc->oformat = file_oformat;
          ^
3739.     av_strlcpy(oc->filename, filename, sizeof(oc->filename));
3740. 
