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

libavformat/segment.c:333:11: Call
331.     }
332. 
333.     ret = ff_write_chained(oc, pkt->stream_index, pkt, s);
               ^
334. 
335. fail:

libavformat/mux.c:728:12: Call
  726.                                      src->streams[pkt->stream_index]->time_base,
  727.                                      dst->streams[dst_stream]->time_base);
  728.     return av_write_frame(dst, &local_pkt);
                  ^
  729. }

libavformat/mux.c:477:9: Assignment
    475. 
    476.     if (ret >= 0)
    477.         s->streams[pkt->stream_index]->nb_frames++;
                 ^
    478.     return ret;
    479. }

libavformat/segment.c:337:9: Call
335. fail:
336.     if (ret < 0)
337.         seg_free_context(seg);
             ^
338. 
339.     return ret;

libavformat/segment.c:191:1: Parameter `seg->avf->nb_programs`
  189. }
  190. 
  191. static void seg_free_context(SegmentContext *seg)
       ^
  192. {
  193.     avio_closep(&seg->pb);

libavformat/segment.c:194:5: Call
  192. {
  193.     avio_closep(&seg->pb);
  194.     avformat_free_context(seg->avf);
           ^
  195.     seg->avf = NULL;
  196. }

libavformat/utils.c:2477:1: <LHS trace>
2475. }
2476. 
2477. void avformat_free_context(AVFormatContext *s)
      ^
2478. {
2479.     int i;

libavformat/utils.c:2477:1: Parameter `s->nb_programs`
    2475. }
    2476. 
    2477. void avformat_free_context(AVFormatContext *s)
          ^
    2478. {
    2479.     int i;

libavformat/utils.c:2491:10: Binary operation: ([0, +oo] - 1):unsigned32 by call to `seg_free_context` 
    2489.         free_stream(&s->streams[i]);
    2490. 
    2491.     for (i = s->nb_programs - 1; i >= 0; i--) {
                   ^
    2492.         av_dict_free(&s->programs[i]->metadata);
    2493.         av_freep(&s->programs[i]->stream_index);
