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

libavformat/segment.c:174:9: Assignment
172.     if (ret) {
173.         oc->streams = NULL;
174.         oc->nb_streams = 0;
             ^
175.         if (seg->list)
176.             avio_close(seg->pb);

libavformat/segment.c:177:9: Call
175.         if (seg->list)
176.             avio_close(seg->pb);
177.         avformat_free_context(oc);
             ^
178.     }
179.     return ret;

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]);
