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

libavformat/segment.c:241:5: Assignment
239.         avio_close(seg->pb);
240.     oc->streams = NULL;
241.     oc->nb_streams = 0;
         ^
242.     avformat_free_context(oc);
243.     return ret;

libavformat/segment.c:242:5: Call
240.     oc->streams = NULL;
241.     oc->nb_streams = 0;
242.     avformat_free_context(oc);
         ^
243.     return ret;
244. }

libavformat/utils.c:2545:1: <LHS trace>
2543. }
2544. 
2545. void avformat_free_context(AVFormatContext *s)
      ^
2546. {
2547.     int i;

libavformat/utils.c:2545:1: Parameter `s->nb_chapters`
  2543. }
  2544. 
  2545. void avformat_free_context(AVFormatContext *s)
        ^
  2546. {
  2547.     int i;

libavformat/utils.c:2577:11: Binary operation: ([-oo, 0] - 1):unsigned32 by call to `avformat_free_context` 
  2575.     av_freep(&s->programs);
  2576.     av_freep(&s->priv_data);
  2577.     while(s->nb_chapters--) {
                  ^
  2578.         av_dict_free(&s->chapters[s->nb_chapters]->metadata);
  2579.         av_free(s->chapters[s->nb_chapters]);
