avprobe.c:387: error: Integer Overflow L2
  ([0, +oo] - 1):unsigned32 by call to `close_input_file`.

avprobe.c:382:13: Call
380.     if (do_show_streams)
381.         for (i = 0; i < fmt_ctx->nb_streams; i++)
382.             show_stream(fmt_ctx, i);
                 ^
383. 
384.     if (do_show_format)

avprobe.c:387:5: Call
385.         show_format(fmt_ctx);
386. 
387.     close_input_file(&fmt_ctx);
         ^
388.     return 0;
389. }

avprobe.c:355:1: Parameter `(*ctx_ptr)->nb_programs`
  353. }
  354. 
  355. static void close_input_file(AVFormatContext **ctx_ptr)
       ^
  356. {
  357.     int i;

avprobe.c:366:5: Call
  364.         avcodec_close(stream->codec);
  365.     }
  366.     avformat_close_input(ctx_ptr);
           ^
  367. }
  368. 

libavformat/utils.c:2640:1: Parameter `(*ps)->nb_programs`
    2638. #endif
    2639. 
    2640. void avformat_close_input(AVFormatContext **ps)
          ^
    2641. {
    2642.     AVFormatContext *s = *ps;

libavformat/utils.c:2648:5: Call
    2646.     if (s->iformat->read_close)
    2647.         s->iformat->read_close(s);
    2648.     avformat_free_context(s);
              ^
    2649.     *ps = NULL;
    2650.     if (pb)

libavformat/utils.c:2590:1: <LHS trace>
2588. }
2589. 
2590. void avformat_free_context(AVFormatContext *s)
      ^
2591. {
2592.     int i;

libavformat/utils.c:2590:1: Parameter `s->nb_programs`
      2588. }
      2589. 
      2590. void avformat_free_context(AVFormatContext *s)
            ^
      2591. {
      2592.     int i;

libavformat/utils.c:2616:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `close_input_file` 
      2614.         av_free(st);
      2615.     }
      2616.     for(i=s->nb_programs-1; i>=0; i--) {
                    ^
      2617.         av_dict_free(&s->programs[i]->metadata);
      2618.         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);
        }
        if (st->attached_pic.data)
            av_free_packet(&st->attached_pic);
        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);
}
['static int probe_file(const char *filename)\n{\n    AVFormatContext *fmt_ctx;\n    int ret, i;\n    if ((ret = open_input_file(&fmt_ctx, filename)))\n        return ret;\n    if (do_show_packets)\n        show_packets(fmt_ctx);\n    if (do_show_streams)\n        for (i = 0; i < fmt_ctx->nb_streams; i++)\n            show_stream(fmt_ctx, i);\n    if (do_show_format)\n        show_format(fmt_ctx);\n    close_input_file(&fmt_ctx);\n    return 0;\n}', 'static void close_input_file(AVFormatContext **ctx_ptr)\n{\n    int i;\n    AVFormatContext *fmt_ctx = *ctx_ptr;\n    for (i = 0; i < fmt_ctx->nb_streams; i++) {\n        AVStream *stream = fmt_ctx->streams[i];\n        avcodec_close(stream->codec);\n    }\n    avformat_close_input(ctx_ptr);\n}', 'void avformat_close_input(AVFormatContext **ps)\n{\n    AVFormatContext *s = *ps;\n    AVIOContext *pb = (s->iformat->flags & AVFMT_NOFILE) || (s->flags & AVFMT_FLAG_CUSTOM_IO) ?\n                       NULL : s->pb;\n    flush_packet_queue(s);\n    if (s->iformat->read_close)\n        s->iformat->read_close(s);\n    avformat_free_context(s);\n    *ps = NULL;\n    if (pb)\n        avio_close(pb);\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        }\n        if (st->attached_pic.data)\n            av_free_packet(&st->attached_pic);\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}']