libavformat/movenc.c:3590: error: Integer Overflow L1
  ([-oo, 0] - 1):unsigned32 by call to `ff_mov_close_hinting`.

libavformat/movenc.c:3585:9: Call
3583.         if (mov->tracks[mov->chapter_track].enc)
3584.             av_free(mov->tracks[mov->chapter_track].enc->extradata);
3585.         av_freep(&mov->tracks[mov->chapter_track].enc);
              ^
3586.     }
3587. 

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/movenc.c:3590:13: Call
3588.     for (i = 0; i < mov->nb_streams; i++) {
3589.         if (mov->tracks[i].tag == MKTAG('r','t','p',' '))
3590.             ff_mov_close_hinting(&mov->tracks[i]);
                  ^
3591.         av_freep(&mov->tracks[i].cluster);
3592.         av_freep(&mov->tracks[i].frag_info);

libavformat/movenchint.c:458:1: Parameter `track->rtp_ctx->nb_chapters`
  456. }
  457. 
  458. void ff_mov_close_hinting(MOVTrack *track)
       ^
  459. {
  460.     AVFormatContext *rtp_ctx = track->rtp_ctx;

libavformat/movenchint.c:470:5: Call
  468.         ffio_free_dyn_buf(&rtp_ctx->pb);
  469.     }
  470.     avformat_free_context(rtp_ctx);
           ^
  471. }

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 `ff_mov_close_hinting` 
    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]);

void avformat_free_context(AVFormatContext *s)
{
    int i, j;
    AVStream *st;
    if (!s)
        return;
    av_opt_free(s);
    if (s->iformat && s->iformat->priv_class && s->priv_data)
        av_opt_free(s->priv_data);
    for (i = 0; i < s->nb_streams; i++) {
        st = s->streams[i];
        for (j = 0; j < st->nb_side_data; j++)
            av_freep(&st->side_data[j].data);
        av_freep(&st->side_data);
        st->nb_side_data = 0;
        if (st->parser) {
            av_parser_close(st->parser);
        }
        if (st->attached_pic.data)
            av_free_packet(&st->attached_pic);
        av_dict_free(&st->metadata);
        av_freep(&st->probe_data.buf);
        av_free(st->index_entries);
        av_free(st->codec->extradata);
        av_free(st->codec->subtitle_header);
        av_free(st->codec);
        av_free(st->priv_data);
        av_free(st->info);
        av_free(st);
    }
    for (i = s->nb_programs - 1; i >= 0; i--) {
        av_dict_free(&s->programs[i]->metadata);
        av_freep(&s->programs[i]->stream_index);
        av_freep(&s->programs[i]);
    }
    av_freep(&s->programs);
    av_freep(&s->priv_data);
    while (s->nb_chapters--) {
        av_dict_free(&s->chapters[s->nb_chapters]->metadata);
        av_free(s->chapters[s->nb_chapters]);
    }
    av_freep(&s->chapters);
    av_dict_free(&s->metadata);
    av_freep(&s->streams);
    av_freep(&s->internal);
    av_free(s);
}
["static void mov_free(AVFormatContext *s)\n{\n    MOVMuxContext *mov = s->priv_data;\n    int i;\n    if (mov->chapter_track) {\n        if (mov->tracks[mov->chapter_track].enc)\n            av_free(mov->tracks[mov->chapter_track].enc->extradata);\n        av_freep(&mov->tracks[mov->chapter_track].enc);\n    }\n    for (i = 0; i < mov->nb_streams; i++) {\n        if (mov->tracks[i].tag == MKTAG('r','t','p',' '))\n            ff_mov_close_hinting(&mov->tracks[i]);\n        av_freep(&mov->tracks[i].cluster);\n        av_freep(&mov->tracks[i].frag_info);\n        if (mov->tracks[i].vos_len)\n            av_free(mov->tracks[i].vos_data);\n    }\n    av_freep(&mov->tracks);\n}", 'void av_freep(void *arg)\n{\n    void *val;\n    memcpy(&val, arg, sizeof(val));\n    memcpy(arg, &(void *){ NULL }, sizeof(val));\n    av_free(val);\n}', 'void ff_mov_close_hinting(MOVTrack *track)\n{\n    AVFormatContext *rtp_ctx = track->rtp_ctx;\n    av_freep(&track->enc);\n    sample_queue_free(&track->sample_queue);\n    if (!rtp_ctx)\n        return;\n    if (rtp_ctx->pb) {\n        av_write_trailer(rtp_ctx);\n        ffio_free_dyn_buf(&rtp_ctx->pb);\n    }\n    avformat_free_context(rtp_ctx);\n}', 'void avformat_free_context(AVFormatContext *s)\n{\n    int i, j;\n    AVStream *st;\n    if (!s)\n        return;\n    av_opt_free(s);\n    if (s->iformat && s->iformat->priv_class && s->priv_data)\n        av_opt_free(s->priv_data);\n    for (i = 0; i < s->nb_streams; i++) {\n        st = s->streams[i];\n        for (j = 0; j < st->nb_side_data; j++)\n            av_freep(&st->side_data[j].data);\n        av_freep(&st->side_data);\n        st->nb_side_data = 0;\n        if (st->parser) {\n            av_parser_close(st->parser);\n        }\n        if (st->attached_pic.data)\n            av_free_packet(&st->attached_pic);\n        av_dict_free(&st->metadata);\n        av_freep(&st->probe_data.buf);\n        av_free(st->index_entries);\n        av_free(st->codec->extradata);\n        av_free(st->codec->subtitle_header);\n        av_free(st->codec);\n        av_free(st->priv_data);\n        av_free(st->info);\n        av_free(st);\n    }\n    for (i = s->nb_programs - 1; i >= 0; i--) {\n        av_dict_free(&s->programs[i]->metadata);\n        av_freep(&s->programs[i]->stream_index);\n        av_freep(&s->programs[i]);\n    }\n    av_freep(&s->programs);\n    av_freep(&s->priv_data);\n    while (s->nb_chapters--) {\n        av_dict_free(&s->chapters[s->nb_chapters]->metadata);\n        av_free(s->chapters[s->nb_chapters]);\n    }\n    av_freep(&s->chapters);\n    av_dict_free(&s->metadata);\n    av_freep(&s->streams);\n    av_freep(&s->internal);\n    av_free(s);\n}']