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

libavformat/rtpenc_mpegts.c:46:9: Call
44.     }
45.     if (chain->rtp_ctx) {
46.         av_write_trailer(chain->rtp_ctx);
            ^
47.         avformat_free_context(chain->rtp_ctx);
48.     }

libavformat/mux.c:608:15: Call
  606.     for (;; ) {
  607.         AVPacket pkt;
  608.         ret = interleave_packet(s, &pkt, NULL, 1);
                     ^
  609.         if (ret < 0) //FIXME cleanup needed for ret<0 ?
  610.             goto fail;

libavformat/mux.c:549:16: Call
    547.         return ret;
    548.     } else
    549.         return ff_interleave_packet_per_dts(s, out, in, flush);
                        ^
    550. }
    551. 

libavformat/mux.c:523:13: Assignment
      521. 
      522.         if (s->streams[out->stream_index]->last_in_packet_buffer == pktl)
      523.             s->streams[out->stream_index]->last_in_packet_buffer = NULL;
                       ^
      524.         av_freep(&pktl);
      525.         return 1;

libavformat/rtpenc_mpegts.c:47:9: Call
45.     if (chain->rtp_ctx) {
46.         av_write_trailer(chain->rtp_ctx);
47.         avformat_free_context(chain->rtp_ctx);
            ^
48.     }
49.     return 0;

libavformat/utils.c:2432:1: <LHS trace>
2430. }
2431. 
2432. void avformat_free_context(AVFormatContext *s)
      ^
2433. {
2434.     int i, j;

libavformat/utils.c:2432:1: Parameter `s->nb_programs`
  2430. }
  2431. 
  2432. void avformat_free_context(AVFormatContext *s)
        ^
  2433. {
  2434.     int i, j;

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