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

libavfilter/vsrc_movie.c:99:16: Call
 97. 
 98.     movie->format_ctx = NULL;
 99.     if ((ret = avformat_open_input(&movie->format_ctx, movie->file_name, iformat, NULL)) < 0) {
                    ^
100.         av_log(ctx, AV_LOG_ERROR,
101.                "Failed to avformat_open_input '%s'\n", movie->file_name);

libavformat/utils.c:256:1: Parameter `(*ps)->nb_programs`
  254. }
  255. 
  256. int avformat_open_input(AVFormatContext **ps, const char *filename,
       ^
  257.                         AVInputFormat *fmt, AVDictionary **options)
  258. {

libavformat/utils.c:336:5: Call
  334.     if (s->pb && !(s->flags & AVFMT_FLAG_CUSTOM_IO))
  335.         avio_close(s->pb);
  336.     avformat_free_context(s);
           ^
  337.     *ps = NULL;
  338.     return ret;

libavformat/utils.c:2477:1: <LHS trace>
2475. }
2476. 
2477. void avformat_free_context(AVFormatContext *s)
      ^
2478. {
2479.     int i;

libavformat/utils.c:2477:1: Parameter `s->nb_programs`
    2475. }
    2476. 
    2477. void avformat_free_context(AVFormatContext *s)
          ^
    2478. {
    2479.     int i;

libavformat/utils.c:2491:10: Binary operation: ([0, +oo] - 1):unsigned32 by call to `avformat_open_input` 
    2489.         free_stream(&s->streams[i]);
    2490. 
    2491.     for (i = s->nb_programs - 1; i >= 0; i--) {
                   ^
    2492.         av_dict_free(&s->programs[i]->metadata);
    2493.         av_freep(&s->programs[i]->stream_index);

void avformat_free_context(AVFormatContext *s)
{
    int i;
    if (!s)
        return;
    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++)
        free_stream(&s->streams[i]);
    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_freep(&s->internal);
    av_free(s);
}
['static av_cold int movie_init(AVFilterContext *ctx)\n{\n    MovieContext *movie = ctx->priv;\n    AVInputFormat *iformat = NULL;\n    AVCodec *codec;\n    int ret;\n    int64_t timestamp;\n    av_register_all();\n    iformat = movie->format_name ? av_find_input_format(movie->format_name) : NULL;\n    movie->format_ctx = NULL;\n    if ((ret = avformat_open_input(&movie->format_ctx, movie->file_name, iformat, NULL)) < 0) {\n        av_log(ctx, AV_LOG_ERROR,\n               "Failed to avformat_open_input \'%s\'\\n", movie->file_name);\n        return ret;\n    }\n    if ((ret = avformat_find_stream_info(movie->format_ctx, NULL)) < 0)\n        av_log(ctx, AV_LOG_WARNING, "Failed to find stream info\\n");\n    if (movie->seek_point > 0) {\n        timestamp = movie->seek_point;\n        if (movie->format_ctx->start_time != AV_NOPTS_VALUE) {\n            if (timestamp > INT64_MAX - movie->format_ctx->start_time) {\n                av_log(ctx, AV_LOG_ERROR,\n                       "%s: seek value overflow with start_time:%"PRId64" seek_point:%"PRId64"\\n",\n                       movie->file_name, movie->format_ctx->start_time, movie->seek_point);\n                return AVERROR(EINVAL);\n            }\n            timestamp += movie->format_ctx->start_time;\n        }\n        if ((ret = av_seek_frame(movie->format_ctx, -1, timestamp, AVSEEK_FLAG_BACKWARD)) < 0) {\n            av_log(ctx, AV_LOG_ERROR, "%s: could not seek to position %"PRId64"\\n",\n                   movie->file_name, timestamp);\n            return ret;\n        }\n    }\n    if ((ret = av_find_best_stream(movie->format_ctx, AVMEDIA_TYPE_VIDEO,\n                                   movie->stream_index, -1, NULL, 0)) < 0) {\n        av_log(ctx, AV_LOG_ERROR, "No video stream with index \'%d\' found\\n",\n               movie->stream_index);\n        return ret;\n    }\n    movie->stream_index = ret;\n    movie->codec_ctx = movie->format_ctx->streams[movie->stream_index]->codec;\n    codec = avcodec_find_decoder(movie->codec_ctx->codec_id);\n    if (!codec) {\n        av_log(ctx, AV_LOG_ERROR, "Failed to find any codec\\n");\n        return AVERROR(EINVAL);\n    }\n    movie->codec_ctx->refcounted_frames = 1;\n    if ((ret = avcodec_open2(movie->codec_ctx, codec, NULL)) < 0) {\n        av_log(ctx, AV_LOG_ERROR, "Failed to open codec\\n");\n        return ret;\n    }\n    movie->w = movie->codec_ctx->width;\n    movie->h = movie->codec_ctx->height;\n    av_log(ctx, AV_LOG_VERBOSE, "seek_point:%"PRIi64" format_name:%s file_name:%s stream_index:%d\\n",\n           movie->seek_point, movie->format_name, movie->file_name,\n           movie->stream_index);\n    return 0;\n}', 'int avformat_open_input(AVFormatContext **ps, const char *filename,\n                        AVInputFormat *fmt, AVDictionary **options)\n{\n    AVFormatContext *s = *ps;\n    int ret = 0;\n    AVDictionary *tmp = NULL;\n    ID3v2ExtraMeta *id3v2_extra_meta = NULL;\n    if (!s && !(s = avformat_alloc_context()))\n        return AVERROR(ENOMEM);\n    if (fmt)\n        s->iformat = fmt;\n    if (options)\n        av_dict_copy(&tmp, *options, 0);\n    if ((ret = av_opt_set_dict(s, &tmp)) < 0)\n        goto fail;\n    if ((ret = init_input(s, filename, &tmp)) < 0)\n        goto fail;\n    if (s->iformat->flags & AVFMT_NEEDNUMBER) {\n        if (!av_filename_number_test(filename)) {\n            ret = AVERROR(EINVAL);\n            goto fail;\n        }\n    }\n    s->duration = s->start_time = AV_NOPTS_VALUE;\n    av_strlcpy(s->filename, filename ? filename : "", sizeof(s->filename));\n    if (s->iformat->priv_data_size > 0) {\n        if (!(s->priv_data = av_mallocz(s->iformat->priv_data_size))) {\n            ret = AVERROR(ENOMEM);\n            goto fail;\n        }\n        if (s->iformat->priv_class) {\n            *(const AVClass **) s->priv_data = s->iformat->priv_class;\n            av_opt_set_defaults(s->priv_data);\n            if ((ret = av_opt_set_dict(s->priv_data, &tmp)) < 0)\n                goto fail;\n        }\n    }\n    if (s->pb)\n        ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta);\n    if (s->iformat->read_header)\n        if ((ret = s->iformat->read_header(s)) < 0)\n            goto fail;\n    if (id3v2_extra_meta &&\n        (ret = ff_id3v2_parse_apic(s, &id3v2_extra_meta)) < 0)\n        goto fail;\n    ff_id3v2_free_extra_meta(&id3v2_extra_meta);\n    if ((ret = queue_attached_pictures(s)) < 0)\n        goto fail;\n    if (s->pb && !s->internal->data_offset)\n        s->internal->data_offset = avio_tell(s->pb);\n    s->internal->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE;\n    if (options) {\n        av_dict_free(options);\n        *options = tmp;\n    }\n    *ps = s;\n    return 0;\nfail:\n    ff_id3v2_free_extra_meta(&id3v2_extra_meta);\n    av_dict_free(&tmp);\n    if (s->pb && !(s->flags & AVFMT_FLAG_CUSTOM_IO))\n        avio_close(s->pb);\n    avformat_free_context(s);\n    *ps = NULL;\n    return ret;\n}', 'void avformat_free_context(AVFormatContext *s)\n{\n    int i;\n    if (!s)\n        return;\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        free_stream(&s->streams[i]);\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_freep(&s->internal);\n    av_free(s);\n}']