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

ffmpeg.c:3628:1: start of procedure opt_output_file()
3626. }
3627. 
3628. static void opt_output_file(const char *filename)
      ^
3629. {
3630.     AVFormatContext *oc;

ffmpeg.c:3633:5: 
3631.     int err, use_video, use_audio, use_subtitle;
3632.     int input_has_video, input_has_audio, input_has_subtitle;
3633.     AVFormatParameters params, *ap = &params;
          ^
3634.     AVOutputFormat *file_oformat;
3635. 

ffmpeg.c:3636:10: Taking false branch
3634.     AVOutputFormat *file_oformat;
3635. 
3636.     if (!strcmp(filename, "-"))
               ^
3637.         filename = "pipe:";
3638. 

ffmpeg.c:3639:5: 
3637.         filename = "pipe:";
3638. 
3639.     oc = avformat_alloc_context();
          ^
3640.     if (!oc) {
3641.         print_error(filename, AVERROR(ENOMEM));

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

libavformat/options.c:84:5: 
  82. {
  83.     AVFormatContext *ic;
  84.     ic = av_malloc(sizeof(AVFormatContext));
          ^
  85.     if (!ic) return ic;
  86.     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:85:10: Taking true branch
  83.     AVFormatContext *ic;
  84.     ic = av_malloc(sizeof(AVFormatContext));
  85.     if (!ic) return ic;
               ^
  86.     avformat_get_context_defaults(ic);
  87.     ic->av_class = &av_format_context_class;

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

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

ffmpeg.c:3640:10: Taking true branch
3638. 
3639.     oc = avformat_alloc_context();
3640.     if (!oc) {
               ^
3641.         print_error(filename, AVERROR(ENOMEM));
3642.         av_exit(1);

ffmpeg.c:3641:9: 
3639.     oc = avformat_alloc_context();
3640.     if (!oc) {
3641.         print_error(filename, AVERROR(ENOMEM));
              ^
3642.         av_exit(1);
3643.     }

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

cmdutils.c:295:5: 
  293. {
  294.     char errbuf[128];
  295.     const char *errbuf_ptr = errbuf;
           ^
  296. 
  297.     if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)

cmdutils.c:297:9: 
  295.     const char *errbuf_ptr = errbuf;
  296. 
  297.     if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
               ^
  298.         errbuf_ptr = strerror(AVUNERROR(err));
  299.     fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);

libavutil/error.c:22:1: start of procedure av_strerror()
    20. #include "avstring.h"
    21. 
    22. int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
        ^
    23. {
    24.     int ret = 0;

libavutil/error.c:24:5: 
    22. int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
    23. {
    24.     int ret = 0;
            ^
    25.     const char *errstr = NULL;
    26. 

libavutil/error.c:25:5: 
    23. {
    24.     int ret = 0;
    25.     const char *errstr = NULL;
            ^
    26. 
    27.     switch (errnum) {

libavutil/error.c:27:5: 
    25.     const char *errstr = NULL;
    26. 
    27.     switch (errnum) {
            ^
    28.     case AVERROR_EOF:               errstr = "End of file"; break;
    29.     case AVERROR_INVALIDDATA:       errstr = "Invalid data found when processing input"; break;

libavutil/error.c:28:5: Switch condition is false. Skipping switch case
    26. 
    27.     switch (errnum) {
    28.     case AVERROR_EOF:               errstr = "End of file"; break;
            ^
    29.     case AVERROR_INVALIDDATA:       errstr = "Invalid data found when processing input"; break;
    30.     case AVERROR_NUMEXPECTED:       errstr = "Number syntax expected in filename"; break;

libavutil/error.c:29:5: Switch condition is false. Skipping switch case
    27.     switch (errnum) {
    28.     case AVERROR_EOF:               errstr = "End of file"; break;
    29.     case AVERROR_INVALIDDATA:       errstr = "Invalid data found when processing input"; break;
            ^
    30.     case AVERROR_NUMEXPECTED:       errstr = "Number syntax expected in filename"; break;
    31.     case AVERROR_PATCHWELCOME:      errstr = "Not yet implemented in FFmpeg, patches welcome"; break;

libavutil/error.c:30:5: Switch condition is false. Skipping switch case
    28.     case AVERROR_EOF:               errstr = "End of file"; break;
    29.     case AVERROR_INVALIDDATA:       errstr = "Invalid data found when processing input"; break;
    30.     case AVERROR_NUMEXPECTED:       errstr = "Number syntax expected in filename"; break;
            ^
    31.     case AVERROR_PATCHWELCOME:      errstr = "Not yet implemented in FFmpeg, patches welcome"; break;
    32.     }

libavutil/error.c:31:5: Switch condition is false. Skipping switch case
    29.     case AVERROR_INVALIDDATA:       errstr = "Invalid data found when processing input"; break;
    30.     case AVERROR_NUMEXPECTED:       errstr = "Number syntax expected in filename"; break;
    31.     case AVERROR_PATCHWELCOME:      errstr = "Not yet implemented in FFmpeg, patches welcome"; break;
            ^
    32.     }
    33. 

libavutil/error.c:34:9: Taking false branch
    32.     }
    33. 
    34.     if (errstr) {
                ^
    35.         av_strlcpy(errbuf, errstr, errbuf_size);
    36.     } else {

libavutil/error.c:38:9: 
    36.     } else {
    37. #if HAVE_STRERROR_R
    38.         ret = strerror_r(AVUNERROR(errnum), errbuf, errbuf_size);
                ^
    39. #else
    40.         ret = -1;

libavutil/error.c:42:13: Taking false branch
    40.         ret = -1;
    41. #endif
    42.         if (ret < 0)
                    ^
    43.             snprintf(errbuf, errbuf_size, "Error number %d occurred", errnum);
    44.     }

libavutil/error.c:46:5: 
    44.     }
    45. 
    46.     return ret;
            ^
    47. }

libavutil/error.c:47:1: return from a call to av_strerror
    45. 
    46.     return ret;
    47. }
        ^

cmdutils.c:297:9: Taking false branch
  295.     const char *errbuf_ptr = errbuf;
  296. 
  297.     if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
               ^
  298.         errbuf_ptr = strerror(AVUNERROR(err));
  299.     fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);

cmdutils.c:299:5: 
  297.     if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
  298.         errbuf_ptr = strerror(AVUNERROR(err));
  299.     fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);
           ^
  300. }
  301. 

cmdutils.c:300:1: return from a call to print_error
  298.         errbuf_ptr = strerror(AVUNERROR(err));
  299.     fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);
  300. }
       ^
  301. 
  302. #define PRINT_LIB_VERSION(outstream,libname,LIBNAME,indent)             \

ffmpeg.c:3642:9: Skipping av_exit(): empty list of specs
3640.     if (!oc) {
3641.         print_error(filename, AVERROR(ENOMEM));
3642.         av_exit(1);
              ^
3643.     }
3644. 

ffmpeg.c:3645:9: Taking true branch
3643.     }
3644. 
3645.     if (last_asked_format) {
              ^
3646.         file_oformat = av_guess_format(last_asked_format, NULL, NULL);
3647.         if (!file_oformat) {

ffmpeg.c:3646:9: Skipping av_guess_format(): empty list of specs
3644. 
3645.     if (last_asked_format) {
3646.         file_oformat = av_guess_format(last_asked_format, NULL, NULL);
              ^
3647.         if (!file_oformat) {
3648.             fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);

ffmpeg.c:3647:14: Taking false branch
3645.     if (last_asked_format) {
3646.         file_oformat = av_guess_format(last_asked_format, NULL, NULL);
3647.         if (!file_oformat) {
                   ^
3648.             fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);
3649.             av_exit(1);

ffmpeg.c:3651:9: 
3649.             av_exit(1);
3650.         }
3651.         last_asked_format = NULL;
              ^
3652.     } else {
3653.         file_oformat = av_guess_format(NULL, filename, NULL);

ffmpeg.c:3661:5: 
3659.     }
3660. 
3661.     oc->oformat = file_oformat;
          ^
3662.     av_strlcpy(oc->filename, filename, sizeof(oc->filename));
3663. 
