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

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

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

libavformat/mux.c:698:9: Call
    696. fail:
    697.     for (i = 0; i < s->nb_streams; i++) {
    698.         av_freep(&s->streams[i]->priv_data);
                 ^
    699.         av_freep(&s->streams[i]->index_entries);
    700.     }

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. fail:
370.     ff_format_io_close(s, &seg->pb);
371.     avformat_free_context(oc);
         ^
372.     return ret;
373. }

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_chapters`
  2475. }
  2476. 
  2477. void avformat_free_context(AVFormatContext *s)
        ^
  2478. {
  2479.     int i;

libavformat/utils.c:2498:12: Binary operation: ([-oo, 0] - 1):unsigned32 by call to `avformat_free_context` 
  2496.     av_freep(&s->programs);
  2497.     av_freep(&s->priv_data);
  2498.     while (s->nb_chapters--) {
                   ^
  2499.         av_dict_free(&s->chapters[s->nb_chapters]->metadata);
  2500.         av_free(s->chapters[s->nb_chapters]);
