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

libavformat/rtpenc_mpegts.c:41:9: Call
39.     }
40.     if (chain->rtp_ctx) {
41.         av_write_trailer(chain->rtp_ctx);
            ^
42.         avformat_free_context(chain->rtp_ctx);
43.     }

libavformat/mux.c:680:15: Call
  678.     for (;; ) {
  679.         AVPacket pkt;
  680.         ret = interleave_packet(s, &pkt, NULL, 1);
                     ^
  681.         if (ret < 0) //FIXME cleanup needed for ret<0 ?
  682.             goto fail;

libavformat/mux.c:619:16: Call
    617.         return ret;
    618.     } else
    619.         return ff_interleave_packet_per_dts(s, out, in, flush);
                        ^
    620. }
    621. 

libavformat/mux.c:593:13: Assignment
      591. 
      592.         if (s->streams[out->stream_index]->last_in_packet_buffer == pktl)
      593.             s->streams[out->stream_index]->last_in_packet_buffer = NULL;
                       ^
      594.         av_freep(&pktl);
      595.         return 1;

libavformat/rtpenc_mpegts.c:42:9: Call
40.     if (chain->rtp_ctx) {
41.         av_write_trailer(chain->rtp_ctx);
42.         avformat_free_context(chain->rtp_ctx);
            ^
43.     }
44.     return 0;

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 `avformat_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);
