libavfilter/vsrc_movie.c:198: error: Integer Overflow L2
  ([0, +oo] - 1):unsigned32 by call to `avformat_close_input`.

libavfilter/vsrc_movie.c:196:9: Call
194.     av_free(movie->format_name);
195.     if (movie->codec_ctx)
196.         avcodec_close(movie->codec_ctx);
             ^
197.     if (movie->format_ctx)
198.         avformat_close_input(&movie->format_ctx);

libavcodec/utils.c:1392:9: Call
  1390.         if (avctx->codec && avctx->codec->close)
  1391.             avctx->codec->close(avctx);
  1392.         avcodec_default_free_buffers(avctx);
                ^
  1393.         avctx->coded_frame = NULL;
  1394.         av_freep(&avctx->internal);

libavcodec/utils.c:1710:9: Call
    1708.         break;
    1709.     case AVMEDIA_TYPE_AUDIO:
    1710.         audio_free_buffers(avctx);
                  ^
    1711.         break;
    1712.     default:

libavfilter/vsrc_movie.c:198:9: Call
196.         avcodec_close(movie->codec_ctx);
197.     if (movie->format_ctx)
198.         avformat_close_input(&movie->format_ctx);
             ^
199.     avfilter_unref_buffer(movie->picref);
200.     av_freep(&movie->frame);

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 `avformat_close_input` 
    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 av_cold void uninit(AVFilterContext *ctx)\n{\n    MovieContext *movie = ctx->priv;\n    av_free(movie->file_name);\n    av_free(movie->format_name);\n    if (movie->codec_ctx)\n        avcodec_close(movie->codec_ctx);\n    if (movie->format_ctx)\n        avformat_close_input(&movie->format_ctx);\n    avfilter_unref_buffer(movie->picref);\n    av_freep(&movie->frame);\n}', 'int avcodec_close(AVCodecContext *avctx)\n{\n    if (ff_lockmgr_cb) {\n        if ((*ff_lockmgr_cb)(&codec_mutex, AV_LOCK_OBTAIN))\n            return -1;\n    }\n    entangled_thread_counter++;\n    if(entangled_thread_counter != 1){\n        av_log(avctx, AV_LOG_ERROR, "insufficient thread locking around avcodec_open/close()\\n");\n        entangled_thread_counter--;\n        return -1;\n    }\n    if (avcodec_is_open(avctx)) {\n        if (HAVE_THREADS && avctx->thread_opaque)\n            ff_thread_free(avctx);\n        if (avctx->codec && avctx->codec->close)\n            avctx->codec->close(avctx);\n        avcodec_default_free_buffers(avctx);\n        avctx->coded_frame = NULL;\n        av_freep(&avctx->internal);\n    }\n    if (avctx->priv_data && avctx->codec && avctx->codec->priv_class)\n        av_opt_free(avctx->priv_data);\n    av_opt_free(avctx);\n    av_freep(&avctx->priv_data);\n    if (av_codec_is_encoder(avctx->codec))\n        av_freep(&avctx->extradata);\n    avctx->codec = NULL;\n    avctx->active_thread_type = 0;\n    entangled_thread_counter--;\n    if (ff_lockmgr_cb) {\n        (*ff_lockmgr_cb)(&codec_mutex, AV_LOCK_RELEASE);\n    }\n    return 0;\n}', 'void avcodec_default_free_buffers(AVCodecContext *avctx)\n{\n    switch (avctx->codec_type) {\n    case AVMEDIA_TYPE_VIDEO:\n        video_free_buffers(avctx);\n        break;\n    case AVMEDIA_TYPE_AUDIO:\n        audio_free_buffers(avctx);\n        break;\n    default:\n        break;\n    }\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}']