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

libavformat/segment.c:342:15: Call
340.             goto fail;
341.         open_null_ctx(&oc->pb);
342.         ret = av_write_trailer(oc);
                   ^
343.         close_null_ctx(oc->pb);
344.     } else {

libavformat/mux.c:589:15: Call
  587.     for (;; ) {
  588.         AVPacket pkt;
  589.         ret = interleave_packet(s, &pkt, NULL, 1);
                     ^
  590.         if (ret < 0) //FIXME cleanup needed for ret<0 ?
  591.             goto fail;

libavformat/mux.c:530:16: Call
    528.         return ret;
    529.     } else
    530.         return ff_interleave_packet_per_dts(s, out, in, flush);
                        ^
    531. }
    532. 

libavformat/mux.c:504:13: Assignment
      502. 
      503.         if (s->streams[out->stream_index]->last_in_packet_buffer == pktl)
      504.             s->streams[out->stream_index]->last_in_packet_buffer = NULL;
                       ^
      505.         av_freep(&pktl);
      506.         return 1;

libavformat/segment.c:357:5: Call
355. 
356. fail:
357.     avio_close(seg->pb);
         ^
358.     avformat_free_context(oc);
359.     return ret;

libavformat/aviobuf.c:800:1: Parameter `s->opaque->is_connected`
  798. }
  799. 
  800. int avio_close(AVIOContext *s)
       ^
  801. {
  802.     URLContext *h;

libavformat/segment.c:358:5: Call
356. fail:
357.     avio_close(seg->pb);
358.     avformat_free_context(oc);
         ^
359.     return ret;
360. }

libavformat/utils.c:2571:1: <LHS trace>
2569. }
2570. 
2571. void avformat_free_context(AVFormatContext *s)
      ^
2572. {
2573.     int i, j;

libavformat/utils.c:2571:1: Parameter `s->nb_programs`
  2569. }
  2570. 
  2571. void avformat_free_context(AVFormatContext *s)
        ^
  2572. {
  2573.     int i, j;

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