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

avprobe.c:368:13: Call
366.     if (do_show_streams)
367.         for (i = 0; i < fmt_ctx->nb_streams; i++)
368.             show_stream(fmt_ctx, i);
                 ^
369. 
370.     if (do_show_format)

avprobe.c:373:5: Call
371.         show_format(fmt_ctx);
372. 
373.     avformat_close_input(&fmt_ctx);
         ^
374.     return 0;
375. }

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

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

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

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

libavformat/utils.c:2615:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `avformat_close_input` 
    2613.         av_free(st);
    2614.     }
    2615.     for(i=s->nb_programs-1; i>=0; i--) {
                  ^
    2616.         av_dict_free(&s->programs[i]->metadata);
    2617.         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    avformat_close_input(&fmt_ctx);\n    return 0;\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}']