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

libavfilter/vsrc_movie.c:177:9: Call
175. 
176.     if (movie->codec_ctx)
177.         avcodec_close(movie->codec_ctx);
             ^
178.     if (movie->format_ctx)
179.         avformat_close_input(&movie->format_ctx);

libavcodec/utils.c:1527:13: Call
  1525.         avctx->coded_frame = NULL;
  1526.         if (!avctx->refcounted_frames)
  1527.             av_frame_unref(&avctx->internal->to_free);
                    ^
  1528.         for (i = 0; i < FF_ARRAY_ELEMS(pool->pools); i++)
  1529.             av_buffer_pool_uninit(&pool->pools[i]);

libavutil/frame.c:289:5: Call
    287.         av_buffer_unref(&frame->extended_buf[i]);
    288.     av_freep(&frame->extended_buf);
    289.     get_frame_defaults(frame);
             ^
    290. }
    291. 

libavutil/frame.c:38:46: Assignment
      36.     frame->pts                 = AV_NOPTS_VALUE;
      37.     frame->key_frame           = 1;
      38.     frame->sample_aspect_ratio = (AVRational){ 0, 1 };
                                                       ^
      39.     frame->format              = -1; /* unknown */
      40.     frame->extended_data       = frame->data;

libavfilter/vsrc_movie.c:179:9: Call
177.         avcodec_close(movie->codec_ctx);
178.     if (movie->format_ctx)
179.         avformat_close_input(&movie->format_ctx);
             ^
180.     av_frame_free(&movie->frame);
181. }

libavformat/utils.c:2538:1: Parameter `(*ps)->nb_chapters`
  2536. }
  2537. 
  2538. void avformat_close_input(AVFormatContext **ps)
        ^
  2539. {
  2540.     AVFormatContext *s = *ps;

libavformat/utils.c:2554:5: Call
  2552.     }
  2553. 
  2554.     avformat_free_context(s);
            ^
  2555. 
  2556.     *ps = NULL;

libavformat/utils.c:2494:1: <LHS trace>
2492. }
2493. 
2494. void avformat_free_context(AVFormatContext *s)
      ^
2495. {
2496.     int i;

libavformat/utils.c:2494:1: Parameter `s->nb_chapters`
    2492. }
    2493. 
    2494. void avformat_free_context(AVFormatContext *s)
          ^
    2495. {
    2496.     int i;

libavformat/utils.c:2528:11: Binary operation: ([-oo, 0] - 1):unsigned32 by call to `avformat_close_input` 
    2526.     av_freep(&s->programs);
    2527.     av_freep(&s->priv_data);
    2528.     while(s->nb_chapters--) {
                    ^
    2529.         av_dict_free(&s->chapters[s->nb_chapters]->metadata);
    2530.         av_free(s->chapters[s->nb_chapters]);

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_freep(&st->probe_data.buf);
        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    if (movie->codec_ctx)\n        avcodec_close(movie->codec_ctx);\n    if (movie->format_ctx)\n        avformat_close_input(&movie->format_ctx);\n    av_frame_free(&movie->frame);\n}', 'int avcodec_close(AVCodecContext *avctx)\n{\n    if (lockmgr_cb) {\n        if ((*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        FramePool *pool = avctx->internal->pool;\n        int i;\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        avctx->coded_frame = NULL;\n        if (!avctx->refcounted_frames)\n            av_frame_unref(&avctx->internal->to_free);\n        for (i = 0; i < FF_ARRAY_ELEMS(pool->pools); i++)\n            av_buffer_pool_uninit(&pool->pools[i]);\n        av_freep(&avctx->internal->pool);\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 (lockmgr_cb) {\n        (*lockmgr_cb)(&codec_mutex, AV_LOCK_RELEASE);\n    }\n    return 0;\n}', 'void av_frame_unref(AVFrame *frame)\n{\n    int i;\n    for (i = 0; i < frame->nb_side_data; i++) {\n        av_freep(&frame->side_data[i]->data);\n        av_dict_free(&frame->side_data[i]->metadata);\n        av_freep(&frame->side_data[i]);\n    }\n    av_freep(&frame->side_data);\n    for (i = 0; i < FF_ARRAY_ELEMS(frame->buf); i++)\n        av_buffer_unref(&frame->buf[i]);\n    for (i = 0; i < frame->nb_extended_buf; i++)\n        av_buffer_unref(&frame->extended_buf[i]);\n    av_freep(&frame->extended_buf);\n    get_frame_defaults(frame);\n}', 'static void get_frame_defaults(AVFrame *frame)\n{\n    if (frame->extended_data != frame->data)\n        av_freep(&frame->extended_data);\n    memset(frame, 0, sizeof(*frame));\n    frame->pts                 = AV_NOPTS_VALUE;\n    frame->key_frame           = 1;\n    frame->sample_aspect_ratio = (AVRational){ 0, 1 };\n    frame->format              = -1;\n    frame->extended_data       = frame->data;\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_freep(&st->probe_data.buf);\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}']