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

ffmpeg.c:3428:1: start of procedure opt_output_file()
3426. }
3427. 
3428. static void opt_output_file(const char *filename)
      ^
3429. {
3430.     AVFormatContext *oc;

ffmpeg.c:3433:5: 
3431.     int use_video, use_audio, use_subtitle;
3432.     int input_has_video, input_has_audio, input_has_subtitle;
3433.     AVFormatParameters params, *ap = &params;
          ^
3434.     AVOutputFormat *file_oformat;
3435. 

ffmpeg.c:3436:10: Taking false branch
3434.     AVOutputFormat *file_oformat;
3435. 
3436.     if (!strcmp(filename, "-"))
               ^
3437.         filename = "pipe:";
3438. 

ffmpeg.c:3439:5: 
3437.         filename = "pipe:";
3438. 
3439.     oc = avformat_alloc_context();
          ^
3440.     if (!oc) {
3441.         print_error(filename, AVERROR(ENOMEM));

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

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

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

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

ffmpeg.c:3440:10: Taking true branch
3438. 
3439.     oc = avformat_alloc_context();
3440.     if (!oc) {
               ^
3441.         print_error(filename, AVERROR(ENOMEM));
3442.         av_exit(1);

ffmpeg.c:3441:9: 
3439.     oc = avformat_alloc_context();
3440.     if (!oc) {
3441.         print_error(filename, AVERROR(ENOMEM));
              ^
3442.         av_exit(1);
3443.     }

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:296:5: 
  294.     char errbuf[128];
  295. 
  296.     switch(err) {
           ^
  297. #if CONFIG_NETWORK
  298.     case AVERROR(FF_NETERROR(EPROTONOSUPPORT)):

cmdutils.c:298:5: Switch condition is false. Skipping switch case
  296.     switch(err) {
  297. #if CONFIG_NETWORK
  298.     case AVERROR(FF_NETERROR(EPROTONOSUPPORT)):
           ^
  299.         fprintf(stderr, "%s: Unsupported network protocol\n", filename);
  300.         break;

cmdutils.c:303:9: 
  301. #endif
  302.     default:
  303.         av_strerror(err, errbuf, sizeof(errbuf));
               ^
  304.         fprintf(stderr, "%s: %s\n", filename, errbuf);
  305.     }

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_NOTSUPP:           errstr = "Operation not supported"; 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_NOTSUPP:           errstr = "Operation not supported"; break;
    31.     case AVERROR_NUMEXPECTED:       errstr = "Number syntax expected in filename"; break;

libavutil/error.c:30:5: Switch condition is true. Entering 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_NOTSUPP:           errstr = "Operation not supported"; break;
            ^
    31.     case AVERROR_NUMEXPECTED:       errstr = "Number syntax expected in filename"; break;
    32.     case AVERROR_PATCHWELCOME:      errstr = "Not yet implemented in FFmpeg, patches welcome"; break;

libavutil/error.c:30:37: 
    28.     case AVERROR_EOF:               errstr = "End of file"; break;
    29.     case AVERROR_INVALIDDATA:       errstr = "Invalid data found when processing input"; break;
    30.     case AVERROR_NOTSUPP:           errstr = "Operation not supported"; break;
                                            ^
    31.     case AVERROR_NUMEXPECTED:       errstr = "Number syntax expected in filename"; break;
    32.     case AVERROR_PATCHWELCOME:      errstr = "Not yet implemented in FFmpeg, patches welcome"; break;

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

libavutil/error.c:36:9: 
    34. 
    35.     if (errstr) {
    36.         av_strlcpy(errbuf, errstr, errbuf_size);
                ^
    37.     } else {
    38. #if HAVE_STRERROR_R

libavutil/avstring.c:64:1: start of procedure av_strlcpy()
      62. }
      63. 
      64. size_t av_strlcpy(char *dst, const char *src, size_t size)
          ^
      65. {
      66.     size_t len = 0;

libavutil/avstring.c:66:5: 
      64. size_t av_strlcpy(char *dst, const char *src, size_t size)
      65. {
      66.     size_t len = 0;
              ^
      67.     while (++len < size && *src)
      68.         *dst++ = *src++;

libavutil/avstring.c:67:12: Loop condition is true. Entering loop body
      65. {
      66.     size_t len = 0;
      67.     while (++len < size && *src)
                     ^
      68.         *dst++ = *src++;
      69.     if (len <= size)

libavutil/avstring.c:67:28: Loop condition is true. Entering loop body
      65. {
      66.     size_t len = 0;
      67.     while (++len < size && *src)
                                     ^
      68.         *dst++ = *src++;
      69.     if (len <= size)

libavutil/avstring.c:68:9: 
      66.     size_t len = 0;
      67.     while (++len < size && *src)
      68.         *dst++ = *src++;
                  ^
      69.     if (len <= size)
      70.         *dst = 0;

libavutil/avstring.c:67:12: Loop condition is false. Leaving loop
      65. {
      66.     size_t len = 0;
      67.     while (++len < size && *src)
                     ^
      68.         *dst++ = *src++;
      69.     if (len <= size)

libavutil/avstring.c:69:9: Taking true branch
      67.     while (++len < size && *src)
      68.         *dst++ = *src++;
      69.     if (len <= size)
                  ^
      70.         *dst = 0;
      71.     return len + strlen(src) - 1;

libavutil/avstring.c:70:9: 
      68.         *dst++ = *src++;
      69.     if (len <= size)
      70.         *dst = 0;
                  ^
      71.     return len + strlen(src) - 1;
      72. }

libavutil/avstring.c:71:5: 
      69.     if (len <= size)
      70.         *dst = 0;
      71.     return len + strlen(src) - 1;
              ^
      72. }
      73. 

libavutil/avstring.c:72:1: return from a call to av_strlcpy
      70.         *dst = 0;
      71.     return len + strlen(src) - 1;
      72. }
          ^
      73. 
      74. size_t av_strlcat(char *dst, const char *src, size_t size)

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

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

cmdutils.c:304:9: 
  302.     default:
  303.         av_strerror(err, errbuf, sizeof(errbuf));
  304.         fprintf(stderr, "%s: %s\n", filename, errbuf);
               ^
  305.     }
  306. }

cmdutils.c:306:1: return from a call to print_error
  304.         fprintf(stderr, "%s: %s\n", filename, errbuf);
  305.     }
  306. }
       ^
  307. 
  308. #define PRINT_LIB_VERSION(outstream,libname,LIBNAME,indent)             \

ffmpeg.c:3442:9: Skipping av_exit(): empty list of specs
3440.     if (!oc) {
3441.         print_error(filename, AVERROR(ENOMEM));
3442.         av_exit(1);
              ^
3443.     }
3444. 

ffmpeg.c:3445:9: Taking true branch
3443.     }
3444. 
3445.     if (last_asked_format) {
              ^
3446.         file_oformat = av_guess_format(last_asked_format, NULL, NULL);
3447.         if (!file_oformat) {

ffmpeg.c:3446:9: Skipping av_guess_format(): empty list of specs
3444. 
3445.     if (last_asked_format) {
3446.         file_oformat = av_guess_format(last_asked_format, NULL, NULL);
              ^
3447.         if (!file_oformat) {
3448.             fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);

ffmpeg.c:3447:14: Taking false branch
3445.     if (last_asked_format) {
3446.         file_oformat = av_guess_format(last_asked_format, NULL, NULL);
3447.         if (!file_oformat) {
                   ^
3448.             fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);
3449.             av_exit(1);

ffmpeg.c:3451:9: 
3449.             av_exit(1);
3450.         }
3451.         last_asked_format = NULL;
              ^
3452.     } else {
3453.         file_oformat = av_guess_format(NULL, filename, NULL);

ffmpeg.c:3461:5: 
3459.     }
3460. 
3461.     oc->oformat = file_oformat;
          ^
3462.     av_strlcpy(oc->filename, filename, sizeof(oc->filename));
3463. 
