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

libavformat/rdt.c:527:15: Call
525.     PayloadContext *rdt = av_mallocz(sizeof(PayloadContext));
526. 
527.     int ret = avformat_open_input(&rdt->rmctx, "", &ff_rdt_demuxer, NULL);
                   ^
528.     if (ret < 0) {
529.         av_free(rdt);

libavformat/utils.c:603:1: Parameter `(*ps)->nb_programs`
  601. }
  602. 
  603. int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options)
       ^
  604. {
  605.     AVFormatContext *s = *ps;

libavformat/utils.c:673:5: Call
  671.     if (s->pb && !(s->flags & AVFMT_FLAG_CUSTOM_IO))
  672.         avio_close(s->pb);
  673.     avformat_free_context(s);
           ^
  674.     *ps = NULL;
  675.     return ret;

libavformat/utils.c:2642:1: <LHS trace>
2640. }
2641. 
2642. void avformat_free_context(AVFormatContext *s)
      ^
2643. {
2644.     int i;

libavformat/utils.c:2642:1: Parameter `s->nb_programs`
    2640. }
    2641. 
    2642. void avformat_free_context(AVFormatContext *s)
          ^
    2643. {
    2644.     int i;

libavformat/utils.c:2667:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `avformat_open_input` 
    2665.         av_free(st);
    2666.     }
    2667.     for(i=s->nb_programs-1; i>=0; i--) {
                  ^
    2668.         av_dict_free(&s->programs[i]->metadata);
    2669.         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);
            av_free_packet(&st->cur_pkt);
        }
        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 PayloadContext *\nrdt_new_context (void)\n{\n    PayloadContext *rdt = av_mallocz(sizeof(PayloadContext));\n    int ret = avformat_open_input(&rdt->rmctx, "", &ff_rdt_demuxer, NULL);\n    if (ret < 0) {\n        av_free(rdt);\n        return NULL;\n    }\n    return rdt;\n}', 'int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options)\n{\n    AVFormatContext *s = *ps;\n    int ret = 0;\n    AVFormatParameters ap = { { 0 } };\n    AVDictionary *tmp = 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)) < 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, 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);\n    if (s->iformat->read_header)\n        if ((ret = s->iformat->read_header(s, &ap)) < 0)\n            goto fail;\n    if (s->pb && !s->data_offset)\n        s->data_offset = avio_tell(s->pb);\n    s->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    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    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            av_free_packet(&st->cur_pkt);\n        }\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}']