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

ffmpeg.c:3353:1: start of procedure opt_output_file()
3351. }
3352. 
3353. static void opt_output_file(const char *filename)
      ^
3354. {
3355.     AVFormatContext *oc;

ffmpeg.c:3358:5: 
3356.     int use_video, use_audio, use_subtitle;
3357.     int input_has_video, input_has_audio, input_has_subtitle;
3358.     AVFormatParameters params, *ap = &params;
          ^
3359.     AVOutputFormat *file_oformat;
3360. 

ffmpeg.c:3361:10: Taking false branch
3359.     AVOutputFormat *file_oformat;
3360. 
3361.     if (!strcmp(filename, "-"))
               ^
3362.         filename = "pipe:";
3363. 

ffmpeg.c:3364:5: 
3362.         filename = "pipe:";
3363. 
3364.     oc = avformat_alloc_context();
          ^
3365.     if (!oc) {
3366.         print_error(filename, AVERROR(ENOMEM));

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

libavformat/options.c:80:5: 
  78. {
  79.     AVFormatContext *ic;
  80.     ic = av_malloc(sizeof(AVFormatContext));
          ^
  81.     if (!ic) return ic;
  82.     avformat_get_context_defaults(ic);

libavutil/mem.c:47:1: start of procedure av_malloc()
    45.    linker will do it automatically. */
    46. 
    47. void *av_malloc(unsigned int size)
        ^
    48. {
    49.     void *ptr = NULL;

libavutil/mem.c:49:5: 
    47. void *av_malloc(unsigned int size)
    48. {
    49.     void *ptr = NULL;
            ^
    50. #if CONFIG_MEMALIGN_HACK
    51.     long diff;

libavutil/mem.c:55:8: Taking false branch
    53. 
    54.     /* let's disallow possible ambiguous cases */
    55.     if(size > (INT_MAX-16) )
               ^
    56.         return NULL;
    57. 

libavutil/mem.c:66:9: Taking false branch
    64.     ((char*)ptr)[-1]= diff;
    65. #elif HAVE_POSIX_MEMALIGN
    66.     if (posix_memalign(&ptr,16,size))
                ^
    67.         ptr = NULL;
    68. #elif HAVE_MEMALIGN

libavutil/mem.c:99:5: 
     97.     ptr = malloc(size);
     98. #endif
     99.     return ptr;
             ^
    100. }
    101. 

libavutil/mem.c:100:1: return from a call to av_malloc
     98. #endif
     99.     return ptr;
    100. }
         ^
    101. 
    102. void *av_realloc(void *ptr, unsigned int size)

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

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

libavformat/options.c:85:1: return from a call to avformat_alloc_context
  83.     ic->av_class = &av_format_context_class;
  84.     return ic;
  85. }
      ^
  86. 
  87. #if LIBAVFORMAT_VERSION_MAJOR < 53

ffmpeg.c:3365:10: Taking true branch
3363. 
3364.     oc = avformat_alloc_context();
3365.     if (!oc) {
               ^
3366.         print_error(filename, AVERROR(ENOMEM));
3367.         av_exit(1);

ffmpeg.c:3366:9: 
3364.     oc = avformat_alloc_context();
3365.     if (!oc) {
3366.         print_error(filename, AVERROR(ENOMEM));
              ^
3367.         av_exit(1);
3368.     }

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

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

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

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

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

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

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

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

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

ffmpeg.c:3367:9: Skipping av_exit(): empty list of specs
3365.     if (!oc) {
3366.         print_error(filename, AVERROR(ENOMEM));
3367.         av_exit(1);
              ^
3368.     }
3369. 

ffmpeg.c:3370:9: Taking true branch
3368.     }
3369. 
3370.     if (last_asked_format) {
              ^
3371.         file_oformat = av_guess_format(last_asked_format, NULL, NULL);
3372.         if (!file_oformat) {

ffmpeg.c:3371:9: Skipping av_guess_format(): empty list of specs
3369. 
3370.     if (last_asked_format) {
3371.         file_oformat = av_guess_format(last_asked_format, NULL, NULL);
              ^
3372.         if (!file_oformat) {
3373.             fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);

ffmpeg.c:3372:14: Taking false branch
3370.     if (last_asked_format) {
3371.         file_oformat = av_guess_format(last_asked_format, NULL, NULL);
3372.         if (!file_oformat) {
                   ^
3373.             fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);
3374.             av_exit(1);

ffmpeg.c:3376:9: 
3374.             av_exit(1);
3375.         }
3376.         last_asked_format = NULL;
              ^
3377.     } else {
3378.         file_oformat = av_guess_format(NULL, filename, NULL);

ffmpeg.c:3386:5: 
3384.     }
3385. 
3386.     oc->oformat = file_oformat;
          ^
3387.     av_strlcpy(oc->filename, filename, sizeof(oc->filename));
3388. 
