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

libavformat/segment.c:352:20: Call
350. 
351.     if (!seg->write_header_trailer) {
352.         if ((ret = segment_end(oc, 0)) < 0)
                        ^
353.             goto fail;
354.         if ((ret = open_null_ctx(&oc->pb)) < 0)

libavformat/segment.c:165:9: Call
  163.     av_write_frame(oc, NULL); /* Flush any buffered data (fragmented mp4) */
  164.     if (write_trailer)
  165.         av_write_trailer(oc);
               ^
  166.     avio_close(oc->pb);
  167. 

libavformat/mux.c:634:9: Call
    632. fail:
    633.     for (i = 0; i < s->nb_streams; i++) {
    634.         av_freep(&s->streams[i]->priv_data);
                 ^
    635.         av_freep(&s->streams[i]->index_entries);
    636.     }

libavutil/mem.c:207:26: Assignment
      205. 
      206.     memcpy(&val, arg, sizeof(val));
      207.     memcpy(arg, &(void *){ NULL }, sizeof(val));
                                    ^
      208.     av_free(val);
      209. }

libavformat/segment.c:371:5: Call
369. 
370. fail:
371.     avio_close(seg->pb);
         ^
372.     avformat_free_context(oc);
373.     return ret;

libavformat/aviobuf.c:816:1: Parameter `s->opaque->is_connected`
  814. }
  815. 
  816. int avio_close(AVIOContext *s)
       ^
  817. {
  818.     URLContext *h;

libavformat/segment.c:372:5: Call
370. fail:
371.     avio_close(seg->pb);
372.     avformat_free_context(oc);
         ^
373.     return ret;
374. }

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

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

libavformat/utils.c:2476:12: Binary operation: ([-oo, 0] - 1):unsigned32 by call to `avformat_free_context` 
  2474.     av_freep(&s->programs);
  2475.     av_freep(&s->priv_data);
  2476.     while (s->nb_chapters--) {
                   ^
  2477.         av_dict_free(&s->chapters[s->nb_chapters]->metadata);
  2478.         av_free(s->chapters[s->nb_chapters]);
