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

ffmpeg.c:3379:1: start of procedure opt_output_file()
3377. }
3378. 
3379. static void opt_output_file(const char *filename)
      ^
3380. {
3381.     AVFormatContext *oc;

ffmpeg.c:3384:5: 
3382.     int use_video, use_audio, use_subtitle;
3383.     int input_has_video, input_has_audio, input_has_subtitle;
3384.     AVFormatParameters params, *ap = &params;
          ^
3385.     AVOutputFormat *file_oformat;
3386. 

ffmpeg.c:3387:10: Taking false branch
3385.     AVOutputFormat *file_oformat;
3386. 
3387.     if (!strcmp(filename, "-"))
               ^
3388.         filename = "pipe:";
3389. 

ffmpeg.c:3390:5: 
3388.         filename = "pipe:";
3389. 
3390.     oc = avformat_alloc_context();
          ^
3391.     if (!oc) {
3392.         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(unsigned int size)
        ^
    65. {
    66.     void *ptr = NULL;

libavutil/mem.c:66:5: 
    64. void *av_malloc(unsigned int 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, unsigned int 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. }
      ^
  87. 
  88. #if LIBAVFORMAT_VERSION_MAJOR < 53

ffmpeg.c:3391:10: Taking true branch
3389. 
3390.     oc = avformat_alloc_context();
3391.     if (!oc) {
               ^
3392.         print_error(filename, AVERROR(ENOMEM));
3393.         av_exit(1);

ffmpeg.c:3392:9: 
3390.     oc = avformat_alloc_context();
3391.     if (!oc) {
3392.         print_error(filename, AVERROR(ENOMEM));
              ^
3393.         av_exit(1);
3394.     }

cmdutils.c:292:1: start of procedure print_error()
  290. }
  291. 
  292. void print_error(const char *filename, int err)
       ^
  293. {
  294.     switch(err) {

cmdutils.c:294:5: 
  292. void print_error(const char *filename, int err)
  293. {
  294.     switch(err) {
           ^
  295.     case AVERROR_NUMEXPECTED:
  296.         fprintf(stderr, "%s: Incorrect image filename syntax.\n"

cmdutils.c:295:5: Switch condition is false. Skipping switch case
  293. {
  294.     switch(err) {
  295.     case AVERROR_NUMEXPECTED:
           ^
  296.         fprintf(stderr, "%s: Incorrect image filename syntax.\n"
  297.                 "Use '%%d' to specify the image number:\n"

cmdutils.c:302:5: Switch condition is false. Skipping switch case
  300.                 filename);
  301.         break;
  302.     case AVERROR_INVALIDDATA:
           ^
  303.         fprintf(stderr, "%s: Error while parsing header\n", filename);
  304.         break;

cmdutils.c:305:5: Switch condition is false. Skipping switch case
  303.         fprintf(stderr, "%s: Error while parsing header\n", filename);
  304.         break;
  305.     case AVERROR_NOFMT:
           ^
  306.         fprintf(stderr, "%s: Unknown format\n", filename);
  307.         break;

cmdutils.c:308:5: Switch condition is false. Skipping switch case
  306.         fprintf(stderr, "%s: Unknown format\n", filename);
  307.         break;
  308.     case AVERROR(EIO):
           ^
  309.         fprintf(stderr, "%s: I/O error occurred\n"
  310.                 "Usually that means that input file is truncated and/or corrupted.\n",

cmdutils.c:313:5: Switch condition is true. Entering switch case
  311.                 filename);
  312.         break;
  313.     case AVERROR(ENOMEM):
           ^
  314.         fprintf(stderr, "%s: memory allocation error occurred\n", filename);
  315.         break;

cmdutils.c:314:9: 
  312.         break;
  313.     case AVERROR(ENOMEM):
  314.         fprintf(stderr, "%s: memory allocation error occurred\n", filename);
               ^
  315.         break;
  316.     case AVERROR(ENOENT):

cmdutils.c:328:1: return from a call to print_error
  326.         break;
  327.     }
  328. }
       ^
  329. 
  330. #define PRINT_LIB_VERSION(outstream,libname,LIBNAME,indent)             \

ffmpeg.c:3393:9: Skipping av_exit(): empty list of specs
3391.     if (!oc) {
3392.         print_error(filename, AVERROR(ENOMEM));
3393.         av_exit(1);
              ^
3394.     }
3395. 

ffmpeg.c:3396:9: Taking true branch
3394.     }
3395. 
3396.     if (last_asked_format) {
              ^
3397.         file_oformat = av_guess_format(last_asked_format, NULL, NULL);
3398.         if (!file_oformat) {

ffmpeg.c:3397:9: Skipping av_guess_format(): empty list of specs
3395. 
3396.     if (last_asked_format) {
3397.         file_oformat = av_guess_format(last_asked_format, NULL, NULL);
              ^
3398.         if (!file_oformat) {
3399.             fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);

ffmpeg.c:3398:14: Taking false branch
3396.     if (last_asked_format) {
3397.         file_oformat = av_guess_format(last_asked_format, NULL, NULL);
3398.         if (!file_oformat) {
                   ^
3399.             fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);
3400.             av_exit(1);

ffmpeg.c:3402:9: 
3400.             av_exit(1);
3401.         }
3402.         last_asked_format = NULL;
              ^
3403.     } else {
3404.         file_oformat = av_guess_format(NULL, filename, NULL);

ffmpeg.c:3412:5: 
3410.     }
3411. 
3412.     oc->oformat = file_oformat;
          ^
3413.     av_strlcpy(oc->filename, filename, sizeof(oc->filename));
3414. 
