ffmpeg.c:458: error: Integer Overflow L2
  ([0, +oo] - 1):unsigned32 by call to `avformat_free_context`.

ffmpeg.c:458:9: Call
456.         if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb)
457.             avio_close(s->pb);
458.         avformat_free_context(s);
             ^
459.         av_free(output_streams_for_file[i]);
460.         av_dict_free(&output_opts[i]);

libavformat/utils.c:2645:1: <LHS trace>
2643. #endif
2644. 
2645. void avformat_free_context(AVFormatContext *s)
      ^
2646. {
2647.     int i;

libavformat/utils.c:2645:1: Parameter `s->nb_programs`
  2643. #endif
  2644. 
  2645. void avformat_free_context(AVFormatContext *s)
        ^
  2646. {
  2647.     int i;

libavformat/utils.c:2670:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `avformat_free_context` 
  2668.         av_free(st);
  2669.     }
  2670.     for(i=s->nb_programs-1; i>=0; i--) {
                ^
  2671.         av_dict_free(&s->programs[i]->metadata);
  2672.         av_freep(&s->programs[i]->stream_index);

void avformat_free_context(AVFormatContext *s)
{
    int i;
    AVStream *st;
    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];
        if (st->parser) {
            av_parser_close(st->parser);
            av_free_packet(&st->cur_pkt);
        }
        av_dict_free(&st->metadata);
        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_free(s);
}
['void exit_program(int ret)\n{\n    int i;\n    for(i=0;i<nb_output_files;i++) {\n        AVFormatContext *s = output_files[i];\n        if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb)\n            avio_close(s->pb);\n        avformat_free_context(s);\n        av_free(output_streams_for_file[i]);\n        av_dict_free(&output_opts[i]);\n    }\n    for(i=0;i<nb_input_files;i++) {\n        av_close_input_file(input_files[i].ctx);\n    }\n    for (i = 0; i < nb_input_streams; i++)\n        av_dict_free(&input_streams[i].opts);\n    av_free(intra_matrix);\n    av_free(inter_matrix);\n    if (vstats_file)\n        fclose(vstats_file);\n    av_free(vstats_filename);\n    av_free(streamid_map);\n    av_free(stream_maps);\n    av_free(meta_data_maps);\n    av_freep(&input_streams);\n    av_freep(&input_files);\n    av_free(video_codec_name);\n    av_free(audio_codec_name);\n    av_free(subtitle_codec_name);\n    av_free(data_codec_name);\n    uninit_opts();\n    av_free(audio_buf);\n    av_free(audio_out);\n    allocated_audio_buf_size= allocated_audio_out_size= 0;\n    av_free(samples);\n#if CONFIG_AVFILTER\n    avfilter_uninit();\n#endif\n    avformat_network_deinit();\n    if (received_sigterm) {\n        fprintf(stderr,\n            "Received signal %d: terminating.\\n",\n            (int) received_sigterm);\n        exit (255);\n    }\n    exit(ret);\n}', 'void avformat_free_context(AVFormatContext *s)\n{\n    int i;\n    AVStream *st;\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        if (st->parser) {\n            av_parser_close(st->parser);\n            av_free_packet(&st->cur_pkt);\n        }\n        av_dict_free(&st->metadata);\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_free(s);\n}']