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

ffmpeg.c:392:9: Call
390.     }
391.     for(i=0;i<nb_input_files;i++)
392.         av_close_input_file(input_files[i]);
             ^
393. 
394.     av_free(intra_matrix);

libavformat/utils.c:2237:1: Parameter `s->nb_programs`
  2235. }
  2236. 
  2237. void av_close_input_file(AVFormatContext *s)
        ^
  2238. {
  2239.     ByteIOContext *pb = s->iformat->flags & AVFMT_NOFILE ? NULL : s->pb;

libavformat/utils.c:2240:5: Call
  2238. {
  2239.     ByteIOContext *pb = s->iformat->flags & AVFMT_NOFILE ? NULL : s->pb;
  2240.     av_close_input_stream(s);
            ^
  2241.     if (pb)
  2242.         url_fclose(pb);

libavformat/utils.c:2196:1: <LHS trace>
2194. }
2195. 
2196. void av_close_input_stream(AVFormatContext *s)
      ^
2197. {
2198.     int i;

libavformat/utils.c:2196:1: Parameter `s->nb_programs`
    2194. }
    2195. 
    2196. void av_close_input_stream(AVFormatContext *s)
          ^
    2197. {
    2198.     int i;

libavformat/utils.c:2220:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `av_close_input_file` 
    2218.         av_free(st);
    2219.     }
    2220.     for(i=s->nb_programs-1; i>=0; i--) {
                  ^
    2221.         av_freep(&s->programs[i]->provider_name);
    2222.         av_freep(&s->programs[i]->name);

void av_close_input_stream(AVFormatContext *s)
{
    int i;
    AVStream *st;
    if (s->cur_st && s->cur_st->parser)
        av_free_packet(&s->cur_pkt);
    if (s->iformat->read_close)
        s->iformat->read_close(s);
    for(i=0;i<s->nb_streams;i++) {
        st = s->streams[i];
        if (st->parser) {
            av_parser_close(st->parser);
        }
        av_free(st->index_entries);
        av_free(st->codec->extradata);
        av_free(st->codec);
        av_free(st->filename);
        av_free(st->priv_data);
        av_free(st);
    }
    for(i=s->nb_programs-1; i>=0; i--) {
        av_freep(&s->programs[i]->provider_name);
        av_freep(&s->programs[i]->name);
        av_freep(&s->programs[i]->stream_index);
        av_freep(&s->programs[i]);
    }
    av_freep(&s->programs);
    flush_packet_queue(s);
    av_freep(&s->priv_data);
    while(s->nb_chapters--) {
        av_free(s->chapters[s->nb_chapters]->title);
        av_free(s->chapters[s->nb_chapters]);
    }
    av_freep(&s->chapters);
    av_free(s);
}
['static int av_exit(int ret)\n{\n    int i;\n    for(i=0;i<nb_output_files;i++) {\n        AVFormatContext *s = output_files[i];\n        int j;\n        if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb)\n            url_fclose(s->pb);\n        for(j=0;j<s->nb_streams;j++) {\n            av_free(s->streams[j]->codec);\n            av_free(s->streams[j]);\n        }\n        av_free(s);\n    }\n    for(i=0;i<nb_input_files;i++)\n        av_close_input_file(input_files[i]);\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(opt_names);\n    av_free(video_codec_name);\n    av_free(audio_codec_name);\n    av_free(subtitle_codec_name);\n    av_free(video_standard);\n#ifdef CONFIG_POWERPC_PERF\n    extern void powerpc_display_perf_report(void);\n    powerpc_display_perf_report();\n#endif\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    return ret;\n}', 'void av_close_input_file(AVFormatContext *s)\n{\n    ByteIOContext *pb = s->iformat->flags & AVFMT_NOFILE ? NULL : s->pb;\n    av_close_input_stream(s);\n    if (pb)\n        url_fclose(pb);\n}', 'void av_close_input_stream(AVFormatContext *s)\n{\n    int i;\n    AVStream *st;\n    if (s->cur_st && s->cur_st->parser)\n        av_free_packet(&s->cur_pkt);\n    if (s->iformat->read_close)\n        s->iformat->read_close(s);\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        }\n        av_free(st->index_entries);\n        av_free(st->codec->extradata);\n        av_free(st->codec);\n        av_free(st->filename);\n        av_free(st->priv_data);\n        av_free(st);\n    }\n    for(i=s->nb_programs-1; i>=0; i--) {\n        av_freep(&s->programs[i]->provider_name);\n        av_freep(&s->programs[i]->name);\n        av_freep(&s->programs[i]->stream_index);\n        av_freep(&s->programs[i]);\n    }\n    av_freep(&s->programs);\n    flush_packet_queue(s);\n    av_freep(&s->priv_data);\n    while(s->nb_chapters--) {\n        av_free(s->chapters[s->nb_chapters]->title);\n        av_free(s->chapters[s->nb_chapters]);\n    }\n    av_freep(&s->chapters);\n    av_free(s);\n}']