diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-11-29 16:09:58 +0100 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-11-29 16:09:58 +0100 |
commit | aaa4abfdb8bb86263f666bc75edee1272076c356 (patch) | |
tree | 55c03b7aa91da45add7cdf77e000a4ce753817d6 /libavformat/rtsp.c | |
parent | 3b55484c30ad003d27398dedf7045efdb8eb1253 (diff) | |
parent | 98063bcf15eb1e9bf9c8758c83c88d51cbb7ace7 (diff) | |
download | ffmpeg-aaa4abfdb8bb86263f666bc75edee1272076c356.tar.gz |
Merge commit '98063bcf15eb1e9bf9c8758c83c88d51cbb7ace7'
* commit '98063bcf15eb1e9bf9c8758c83c88d51cbb7ace7':
rtsp: Do not assume getnameinfo cannot fail
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r-- | libavformat/rtsp.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index e01dfd7b2d..3e012cd93d 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -2285,8 +2285,14 @@ static int sdp_read_header(AVFormatContext *s) if (!(rt->rtsp_flags & RTSP_FLAG_CUSTOM_IO)) { AVDictionary *opts = map_to_opts(rt); - getnameinfo((struct sockaddr*) &rtsp_st->sdp_ip, sizeof(rtsp_st->sdp_ip), - namebuf, sizeof(namebuf), NULL, 0, NI_NUMERICHOST); + err = getnameinfo((struct sockaddr*) &rtsp_st->sdp_ip, + sizeof(rtsp_st->sdp_ip), + namebuf, sizeof(namebuf), NULL, 0, NI_NUMERICHOST); + if (err) { + av_log(s, AV_LOG_ERROR, "getnameinfo: %s\n", gai_strerror(err)); + err = AVERROR(EIO); + goto fail; + } ff_url_join(url, sizeof(url), "rtp", NULL, namebuf, rtsp_st->sdp_port, "?localport=%d&ttl=%d&connect=%d&write_to_source=%d", |