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

ffmpeg.c:3137:1: start of procedure opt_output_file()
3135. }
3136. 
3137. static void opt_output_file(const char *filename)
      ^
3138. {
3139.     AVFormatContext *oc;

ffmpeg.c:3142:5: 
3140.     int use_video, use_audio, use_subtitle;
3141.     int input_has_video, input_has_audio, input_has_subtitle, i;
3142.     AVFormatParameters params, *ap = &params;
          ^
3143. 
3144.     if (!strcmp(filename, "-"))

ffmpeg.c:3144:10: Taking false branch
3142.     AVFormatParameters params, *ap = &params;
3143. 
3144.     if (!strcmp(filename, "-"))
               ^
3145.         filename = "pipe:";
3146. 

ffmpeg.c:3147:5: 
3145.         filename = "pipe:";
3146. 
3147.     oc = av_alloc_format_context();
          ^
3148. 
3149.     if (!file_oformat) {

libavformat/utils.c:346:1: start of procedure av_alloc_format_context()
  344. }
  345. 
  346. AVFormatContext *av_alloc_format_context(void)
       ^
  347. {
  348.     AVFormatContext *ic;

libavformat/utils.c:349:5: 
  347. {
  348.     AVFormatContext *ic;
  349.     ic = av_malloc(sizeof(AVFormatContext));
           ^
  350.     if (!ic) return ic;
  351.     avformat_get_context_defaults(ic);

libavutil/mem.c:42:1: start of procedure av_malloc()
    40.    linker will do it automatically */
    41. 
    42. void *av_malloc(unsigned int size)
        ^
    43. {
    44.     void *ptr;

libavutil/mem.c:50:8: Taking false branch
    48. 
    49.     /* let's disallow possible ambiguous cases */
    50.     if(size > (INT_MAX-16) )
               ^
    51.         return NULL;
    52. 

libavutil/mem.c:61:5: Skipping memalign(): method has no implementation
    59.     ((char*)ptr)[-1]= diff;
    60. #elif defined (HAVE_MEMALIGN)
    61.     ptr = memalign(16,size);
            ^
    62.     /* Why 64?
    63.        Indeed, we should align it:

libavutil/mem.c:91:5: 
    89.     ptr = malloc(size);
    90. #endif
    91.     return ptr;
            ^
    92. }
    93. 

libavutil/mem.c:92:1: return from a call to av_malloc
    90. #endif
    91.     return ptr;
    92. }
        ^
    93. 
    94. void *av_realloc(void *ptr, unsigned int size)

libavformat/utils.c:350:10: Taking true branch
  348.     AVFormatContext *ic;
  349.     ic = av_malloc(sizeof(AVFormatContext));
  350.     if (!ic) return ic;
                ^
  351.     avformat_get_context_defaults(ic);
  352.     ic->av_class = &av_format_context_class;

libavformat/utils.c:350:14: 
  348.     AVFormatContext *ic;
  349.     ic = av_malloc(sizeof(AVFormatContext));
  350.     if (!ic) return ic;
                    ^
  351.     avformat_get_context_defaults(ic);
  352.     ic->av_class = &av_format_context_class;

libavformat/utils.c:354:1: return from a call to av_alloc_format_context
  352.     ic->av_class = &av_format_context_class;
  353.     return ic;
  354. }
       ^
  355. 
  356. int av_open_input_stream(AVFormatContext **ic_ptr,

ffmpeg.c:3149:10: Taking false branch
3147.     oc = av_alloc_format_context();
3148. 
3149.     if (!file_oformat) {
               ^
3150.         file_oformat = guess_format(NULL, filename, NULL);
3151.         if (!file_oformat) {

ffmpeg.c:3158:5: 
3156.     }
3157. 
3158.     oc->oformat = file_oformat;
          ^
3159.     av_strlcpy(oc->filename, filename, sizeof(oc->filename));
3160. 
