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

libavformat/rtsp.c:2175:5: 
2173.                  NULL, 0, s->filename);
2174. 
2175.     snprintf(sdp, sizeof(sdp),
          ^
2176.              "v=0\r\nc=IN IP%d %s\r\nm=%s %d RTP/AVP %d\r\n",
2177.              addr.ss_family == AF_INET ? 4 : 6, host,

static int rtp_read_header(AVFormatContext *s,
                           AVFormatParameters *ap)
{
    uint8_t recvbuf[1500];
    char host[500], sdp[500];
    int ret, port;
    URLContext* in = NULL;
    int payload_type;
    AVCodecContext codec;
    struct sockaddr_storage addr;
    ByteIOContext pb;
    socklen_t addrlen = sizeof(addr);
    if (!ff_network_init())
        return AVERROR(EIO);
    ret = url_open(&in, s->filename, URL_RDONLY);
    if (ret)
        goto fail;
    while (1) {
        ret = url_read(in, recvbuf, sizeof(recvbuf));
        if (ret == AVERROR(EAGAIN))
            continue;
        if (ret < 0)
            goto fail;
        if (ret < 12) {
            av_log(s, AV_LOG_WARNING, "Received too short packet\n");
            continue;
        }
        if ((recvbuf[0] & 0xc0) != 0x80) {
            av_log(s, AV_LOG_WARNING, "Unsupported RTP version packet "
                                      "received\n");
            continue;
        }
        payload_type = recvbuf[1] & 0x7f;
        break;
    }
    getsockname(url_get_file_handle(in), (struct sockaddr*) &addr, &addrlen);
    url_close(in);
    in = NULL;
    memset(&codec, 0, sizeof(codec));
    if (ff_rtp_get_codec_info(&codec, payload_type)) {
        av_log(s, AV_LOG_ERROR, "Unable to receive RTP payload type %d "
                                "without an SDP file describing it\n",
                                 payload_type);
        goto fail;
    }
    if (codec.codec_type != AVMEDIA_TYPE_DATA) {
        av_log(s, AV_LOG_WARNING, "Guessing on RTP content - if not received "
                                  "properly you need an SDP file "
                                  "describing it\n");
    }
    av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &port,
                 NULL, 0, s->filename);
    snprintf(sdp, sizeof(sdp),
             "v=0\r\nc=IN IP%d %s\r\nm=%s %d RTP/AVP %d\r\n",
             addr.ss_family == AF_INET ? 4 : 6, host,
             codec.codec_type == AVMEDIA_TYPE_DATA  ? "application" :
             codec.codec_type == AVMEDIA_TYPE_VIDEO ? "video" : "audio",
             port, payload_type);
    av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", sdp);
    init_put_byte(&pb, sdp, strlen(sdp), 0, NULL, NULL, NULL, NULL);
    s->pb = &pb;
    ff_network_close();
    ret = sdp_read_header(s, ap);
    s->pb = NULL;
    return ret;
fail:
    if (in)
        url_close(in);
    ff_network_close();
    return ret;
}
['static int rtp_read_header(AVFormatContext *s,\n                           AVFormatParameters *ap)\n{\n    uint8_t recvbuf[1500];\n    char host[500], sdp[500];\n    int ret, port;\n    URLContext* in = NULL;\n    int payload_type;\n    AVCodecContext codec;\n    struct sockaddr_storage addr;\n    ByteIOContext pb;\n    socklen_t addrlen = sizeof(addr);\n    if (!ff_network_init())\n        return AVERROR(EIO);\n    ret = url_open(&in, s->filename, URL_RDONLY);\n    if (ret)\n        goto fail;\n    while (1) {\n        ret = url_read(in, recvbuf, sizeof(recvbuf));\n        if (ret == AVERROR(EAGAIN))\n            continue;\n        if (ret < 0)\n            goto fail;\n        if (ret < 12) {\n            av_log(s, AV_LOG_WARNING, "Received too short packet\\n");\n            continue;\n        }\n        if ((recvbuf[0] & 0xc0) != 0x80) {\n            av_log(s, AV_LOG_WARNING, "Unsupported RTP version packet "\n                                      "received\\n");\n            continue;\n        }\n        payload_type = recvbuf[1] & 0x7f;\n        break;\n    }\n    getsockname(url_get_file_handle(in), (struct sockaddr*) &addr, &addrlen);\n    url_close(in);\n    in = NULL;\n    memset(&codec, 0, sizeof(codec));\n    if (ff_rtp_get_codec_info(&codec, payload_type)) {\n        av_log(s, AV_LOG_ERROR, "Unable to receive RTP payload type %d "\n                                "without an SDP file describing it\\n",\n                                 payload_type);\n        goto fail;\n    }\n    if (codec.codec_type != AVMEDIA_TYPE_DATA) {\n        av_log(s, AV_LOG_WARNING, "Guessing on RTP content - if not received "\n                                  "properly you need an SDP file "\n                                  "describing it\\n");\n    }\n    av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &port,\n                 NULL, 0, s->filename);\n    snprintf(sdp, sizeof(sdp),\n             "v=0\\r\\nc=IN IP%d %s\\r\\nm=%s %d RTP/AVP %d\\r\\n",\n             addr.ss_family == AF_INET ? 4 : 6, host,\n             codec.codec_type == AVMEDIA_TYPE_DATA  ? "application" :\n             codec.codec_type == AVMEDIA_TYPE_VIDEO ? "video" : "audio",\n             port, payload_type);\n    av_log(s, AV_LOG_VERBOSE, "SDP:\\n%s\\n", sdp);\n    init_put_byte(&pb, sdp, strlen(sdp), 0, NULL, NULL, NULL, NULL);\n    s->pb = &pb;\n    ff_network_close();\n    ret = sdp_read_header(s, ap);\n    s->pb = NULL;\n    return ret;\nfail:\n    if (in)\n        url_close(in);\n    ff_network_close();\n    return ret;\n}']