libavformat/segment.c:118: error: Integer Overflow L2
  ([0, +oo] - 1):unsigned32 by call to `avformat_free_context`.

libavformat/segment.c:118:9: Call
116. 
117.     if (write_header) {
118.         avformat_free_context(oc);
             ^
119.         c->avf = NULL;
120.         if ((err = segment_mux_init(s)) < 0)

libavformat/utils.c:2595:1: <LHS trace>
2593. }
2594. 
2595. void avformat_free_context(AVFormatContext *s)
      ^
2596. {
2597.     int i;

libavformat/utils.c:2595:1: Parameter `s->nb_programs`
  2593. }
  2594. 
  2595. void avformat_free_context(AVFormatContext *s)
        ^
  2596. {
  2597.     int i;

libavformat/utils.c:2622:10: Binary operation: ([0, +oo] - 1):unsigned32 by call to `avformat_free_context` 
  2620.         av_free(st);
  2621.     }
  2622.     for (i = s->nb_programs - 1; i >= 0; i--) {
                 ^
  2623.         av_dict_free(&s->programs[i]->metadata);
  2624.         av_freep(&s->programs[i]->stream_index);
