libavformat/rtsp.c:1960: error: Uninitialized Value
  The value read from tcp_fd was never initialized.

libavformat/rtsp.c:1960:26: 
1958.         n = poll(p, rt->max_p, POLL_TIMEOUT_MS);
1959.         if (n > 0) {
1960.             int j = 1 - (tcp_fd == -1);
                               ^
1961.             timeout_cnt = 0;
1962.             for (i = 0; i < rt->nb_rtsp_streams; i++) {

static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
                           uint8_t *buf, int buf_size, int64_t wait_end)
{
    RTSPState *rt = s->priv_data;
    RTSPStream *rtsp_st;
    int n, i, ret, tcp_fd, timeout_cnt = 0;
    struct pollfd *p = rt->p;
    int *fds = NULL, fdsnum, fdsidx;
    if (!p) {
        p = rt->p = av_malloc_array(2 * (rt->nb_rtsp_streams + 1), sizeof(struct pollfd));
        if (!p)
            return AVERROR(ENOMEM);
        if (rt->rtsp_hd) {
            tcp_fd = ffurl_get_file_handle(rt->rtsp_hd);
            p[rt->max_p].fd = tcp_fd;
            p[rt->max_p++].events = POLLIN;
        } else {
            tcp_fd = -1;
        }
        for (i = 0; i < rt->nb_rtsp_streams; i++) {
            rtsp_st = rt->rtsp_streams[i];
            if (rtsp_st->rtp_handle) {
                if (ret = ffurl_get_multi_file_handle(rtsp_st->rtp_handle,
                                                      &fds, &fdsnum)) {
                    av_log(s, AV_LOG_ERROR, "Unable to recover rtp ports\n");
                    return ret;
                }
                if (fdsnum != 2) {
                    av_log(s, AV_LOG_ERROR,
                           "Number of fds %d not supported\n", fdsnum);
                    return AVERROR_INVALIDDATA;
                }
                for (fdsidx = 0; fdsidx < fdsnum; fdsidx++) {
                    p[rt->max_p].fd       = fds[fdsidx];
                    p[rt->max_p++].events = POLLIN;
                }
                av_free(fds);
            }
        }
    }
    for (;;) {
        if (ff_check_interrupt(&s->interrupt_callback))
            return AVERROR_EXIT;
        if (wait_end && wait_end - av_gettime_relative() < 0)
            return AVERROR(EAGAIN);
        n = poll(p, rt->max_p, POLL_TIMEOUT_MS);
        if (n > 0) {
            int j = 1 - (tcp_fd == -1);
            timeout_cnt = 0;
            for (i = 0; i < rt->nb_rtsp_streams; i++) {
                rtsp_st = rt->rtsp_streams[i];
                if (rtsp_st->rtp_handle) {
                    if (p[j].revents & POLLIN || p[j+1].revents & POLLIN) {
                        ret = ffurl_read(rtsp_st->rtp_handle, buf, buf_size);
                        if (ret > 0) {
                            *prtsp_st = rtsp_st;
                            return ret;
                        }
                    }
                    j+=2;
                }
            }
#if CONFIG_RTSP_DEMUXER
            if (tcp_fd != -1 && p[0].revents & POLLIN) {
                if (rt->rtsp_flags & RTSP_FLAG_LISTEN) {
                    if (rt->state == RTSP_STATE_STREAMING) {
                        if (!ff_rtsp_parse_streaming_commands(s))
                            return AVERROR_EOF;
                        else
                            av_log(s, AV_LOG_WARNING,
                                   "Unable to answer to TEARDOWN\n");
                    } else
                        return 0;
                } else {
                    RTSPMessageHeader reply;
                    ret = ff_rtsp_read_reply(s, &reply, NULL, 0, NULL);
                    if (ret < 0)
                        return ret;
                    if (rt->state != RTSP_STATE_STREAMING)
                        return 0;
                }
            }
#endif
        } else if (n == 0 && ++timeout_cnt >= MAX_TIMEOUTS) {
            return AVERROR(ETIMEDOUT);
        } else if (n < 0 && errno != EINTR)
            return AVERROR(errno);
    }
}
['static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,\n                           uint8_t *buf, int buf_size, int64_t wait_end)\n{\n    RTSPState *rt = s->priv_data;\n    RTSPStream *rtsp_st;\n    int n, i, ret, tcp_fd, timeout_cnt = 0;\n    struct pollfd *p = rt->p;\n    int *fds = NULL, fdsnum, fdsidx;\n    if (!p) {\n        p = rt->p = av_malloc_array(2 * (rt->nb_rtsp_streams + 1), sizeof(struct pollfd));\n        if (!p)\n            return AVERROR(ENOMEM);\n        if (rt->rtsp_hd) {\n            tcp_fd = ffurl_get_file_handle(rt->rtsp_hd);\n            p[rt->max_p].fd = tcp_fd;\n            p[rt->max_p++].events = POLLIN;\n        } else {\n            tcp_fd = -1;\n        }\n        for (i = 0; i < rt->nb_rtsp_streams; i++) {\n            rtsp_st = rt->rtsp_streams[i];\n            if (rtsp_st->rtp_handle) {\n                if (ret = ffurl_get_multi_file_handle(rtsp_st->rtp_handle,\n                                                      &fds, &fdsnum)) {\n                    av_log(s, AV_LOG_ERROR, "Unable to recover rtp ports\\n");\n                    return ret;\n                }\n                if (fdsnum != 2) {\n                    av_log(s, AV_LOG_ERROR,\n                           "Number of fds %d not supported\\n", fdsnum);\n                    return AVERROR_INVALIDDATA;\n                }\n                for (fdsidx = 0; fdsidx < fdsnum; fdsidx++) {\n                    p[rt->max_p].fd       = fds[fdsidx];\n                    p[rt->max_p++].events = POLLIN;\n                }\n                av_free(fds);\n            }\n        }\n    }\n    for (;;) {\n        if (ff_check_interrupt(&s->interrupt_callback))\n            return AVERROR_EXIT;\n        if (wait_end && wait_end - av_gettime_relative() < 0)\n            return AVERROR(EAGAIN);\n        n = poll(p, rt->max_p, POLL_TIMEOUT_MS);\n        if (n > 0) {\n            int j = 1 - (tcp_fd == -1);\n            timeout_cnt = 0;\n            for (i = 0; i < rt->nb_rtsp_streams; i++) {\n                rtsp_st = rt->rtsp_streams[i];\n                if (rtsp_st->rtp_handle) {\n                    if (p[j].revents & POLLIN || p[j+1].revents & POLLIN) {\n                        ret = ffurl_read(rtsp_st->rtp_handle, buf, buf_size);\n                        if (ret > 0) {\n                            *prtsp_st = rtsp_st;\n                            return ret;\n                        }\n                    }\n                    j+=2;\n                }\n            }\n#if CONFIG_RTSP_DEMUXER\n            if (tcp_fd != -1 && p[0].revents & POLLIN) {\n                if (rt->rtsp_flags & RTSP_FLAG_LISTEN) {\n                    if (rt->state == RTSP_STATE_STREAMING) {\n                        if (!ff_rtsp_parse_streaming_commands(s))\n                            return AVERROR_EOF;\n                        else\n                            av_log(s, AV_LOG_WARNING,\n                                   "Unable to answer to TEARDOWN\\n");\n                    } else\n                        return 0;\n                } else {\n                    RTSPMessageHeader reply;\n                    ret = ff_rtsp_read_reply(s, &reply, NULL, 0, NULL);\n                    if (ret < 0)\n                        return ret;\n                    if (rt->state != RTSP_STATE_STREAMING)\n                        return 0;\n                }\n            }\n#endif\n        } else if (n == 0 && ++timeout_cnt >= MAX_TIMEOUTS) {\n            return AVERROR(ETIMEDOUT);\n        } else if (n < 0 && errno != EINTR)\n            return AVERROR(errno);\n    }\n}']