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

ffmpeg.c:3346:1: start of procedure opt_output_file()
3344. }
3345. 
3346. static void opt_output_file(const char *filename)
      ^
3347. {
3348.     AVFormatContext *oc;

ffmpeg.c:3351:5: 
3349.     int use_video, use_audio, use_subtitle;
3350.     int input_has_video, input_has_audio, input_has_subtitle;
3351.     AVFormatParameters params, *ap = &params;
          ^
3352.     AVOutputFormat *file_oformat;
3353. 

ffmpeg.c:3354:10: Taking false branch
3352.     AVOutputFormat *file_oformat;
3353. 
3354.     if (!strcmp(filename, "-"))
               ^
3355.         filename = "pipe:";
3356. 

ffmpeg.c:3357:5: 
3355.         filename = "pipe:";
3356. 
3357.     oc = avformat_alloc_context();
          ^
3358.     if (!oc) {
3359.         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:3358:10: Taking true branch
3356. 
3357.     oc = avformat_alloc_context();
3358.     if (!oc) {
               ^
3359.         print_error(filename, AVERROR(ENOMEM));
3360.         av_exit(1);

ffmpeg.c:3359:9: 
3357.     oc = avformat_alloc_context();
3358.     if (!oc) {
3359.         print_error(filename, AVERROR(ENOMEM));
              ^
3360.         av_exit(1);
3361.     }

cmdutils.c:272:1: start of procedure print_error()
  270. }
  271. 
  272. void print_error(const char *filename, int err)
       ^
  273. {
  274.     switch(err) {

cmdutils.c:274:5: 
  272. void print_error(const char *filename, int err)
  273. {
  274.     switch(err) {
           ^
  275.     case AVERROR_NUMEXPECTED:
  276.         fprintf(stderr, "%s: Incorrect image filename syntax.\n"

cmdutils.c:275:5: Switch condition is false. Skipping switch case
  273. {
  274.     switch(err) {
  275.     case AVERROR_NUMEXPECTED:
           ^
  276.         fprintf(stderr, "%s: Incorrect image filename syntax.\n"
  277.                 "Use '%%d' to specify the image number:\n"

cmdutils.c:282:5: Switch condition is false. Skipping switch case
  280.                 filename);
  281.         break;
  282.     case AVERROR_INVALIDDATA:
           ^
  283.         fprintf(stderr, "%s: Error while parsing header\n", filename);
  284.         break;

cmdutils.c:285:5: Switch condition is false. Skipping switch case
  283.         fprintf(stderr, "%s: Error while parsing header\n", filename);
  284.         break;
  285.     case AVERROR_NOFMT:
           ^
  286.         fprintf(stderr, "%s: Unknown format\n", filename);
  287.         break;

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

cmdutils.c:293:5: Switch condition is true. Entering switch case
  291.                 filename);
  292.         break;
  293.     case AVERROR(ENOMEM):
           ^
  294.         fprintf(stderr, "%s: memory allocation error occurred\n", filename);
  295.         break;

cmdutils.c:294:9: 
  292.         break;
  293.     case AVERROR(ENOMEM):
  294.         fprintf(stderr, "%s: memory allocation error occurred\n", filename);
               ^
  295.         break;
  296.     case AVERROR(ENOENT):

cmdutils.c:308:1: return from a call to print_error
  306.         break;
  307.     }
  308. }
       ^
  309. 
  310. #define PRINT_LIB_VERSION(outstream,libname,LIBNAME,indent) \

ffmpeg.c:3360:9: Skipping av_exit(): empty list of specs
3358.     if (!oc) {
3359.         print_error(filename, AVERROR(ENOMEM));
3360.         av_exit(1);
              ^
3361.     }
3362. 

ffmpeg.c:3363:9: Taking true branch
3361.     }
3362. 
3363.     if (last_asked_format) {
              ^
3364.         file_oformat = guess_format(last_asked_format, NULL, NULL);
3365.         if (!file_oformat) {

ffmpeg.c:3364:9: Skipping guess_format(): empty list of specs
3362. 
3363.     if (last_asked_format) {
3364.         file_oformat = guess_format(last_asked_format, NULL, NULL);
              ^
3365.         if (!file_oformat) {
3366.             fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);

ffmpeg.c:3365:14: Taking false branch
3363.     if (last_asked_format) {
3364.         file_oformat = guess_format(last_asked_format, NULL, NULL);
3365.         if (!file_oformat) {
                   ^
3366.             fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);
3367.             av_exit(1);

ffmpeg.c:3369:9: 
3367.             av_exit(1);
3368.         }
3369.         last_asked_format = NULL;
              ^
3370.     } else {
3371.         file_oformat = guess_format(NULL, filename, NULL);

ffmpeg.c:3379:5: 
3377.     }
3378. 
3379.     oc->oformat = file_oformat;
          ^
3380.     av_strlcpy(oc->filename, filename, sizeof(oc->filename));
3381. 
