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

avprobe.c:779:13: Call
777.         probe_array_header("streams");
778.         for (i = 0; i < fmt_ctx->nb_streams; i++)
779.             show_stream(fmt_ctx, i);
                 ^
780.         probe_array_footer("streams");
781.     }

avprobe.c:786:5: Call
784.         show_packets(fmt_ctx);
785. 
786.     close_input_file(&fmt_ctx);
         ^
787.     return 0;
788. }

avprobe.c:751:1: Parameter `(*ctx_ptr)->nb_programs`
  749. }
  750. 
  751. static void close_input_file(AVFormatContext **ctx_ptr)
       ^
  752. {
  753.     int i;

avprobe.c:762:5: Call
  760.         avcodec_close(stream->codec);
  761.     }
  762.     avformat_close_input(ctx_ptr);
           ^
  763. }
  764. 

libavformat/utils.c:2702:1: Parameter `(*ps)->nb_programs`
    2700. #endif
    2701. 
    2702. void avformat_close_input(AVFormatContext **ps)
          ^
    2703. {
    2704.     AVFormatContext *s = *ps;

libavformat/utils.c:2718:5: Call
    2716.     }
    2717. 
    2718.     avformat_free_context(s);
              ^
    2719. 
    2720.     *ps = NULL;

libavformat/utils.c:2652:1: <LHS trace>
2650. }
2651. 
2652. void avformat_free_context(AVFormatContext *s)
      ^
2653. {
2654.     int i;

libavformat/utils.c:2652:1: Parameter `s->nb_programs`
      2650. }
      2651. 
      2652. void avformat_free_context(AVFormatContext *s)
            ^
      2653. {
      2654.     int i;

libavformat/utils.c:2678:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `close_input_file` 
      2676.         av_free(st);
      2677.     }
      2678.     for(i=s->nb_programs-1; i>=0; i--) {
                    ^
      2679.         av_dict_free(&s->programs[i]->metadata);
      2680.         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_format)\n        show_format(fmt_ctx);\n    if (do_show_streams) {\n        probe_array_header("streams");\n        for (i = 0; i < fmt_ctx->nb_streams; i++)\n            show_stream(fmt_ctx, i);\n        probe_array_footer("streams");\n    }\n    if (do_show_packets)\n        show_packets(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->pb;\n    if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) &&\n        (s->flags & AVFMT_FLAG_CUSTOM_IO))\n        pb = NULL;\n    flush_packet_queue(s);\n    if (s->iformat) {\n        if (s->iformat->read_close)\n            s->iformat->read_close(s);\n    }\n    avformat_free_context(s);\n    *ps = NULL;\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}']