diff options
author | Martin Storsjö <martin@martin.st> | 2010-01-07 08:11:56 +0000 |
---|---|---|
committer | Luca Abeni <lucabe72@email.it> | 2010-01-07 08:11:56 +0000 |
commit | c47b0738b559c3ded0e2941b89a970f54d73b283 (patch) | |
tree | c24caacfd3cadf52790af9ecd811c1c7226dd924 /libavformat/sdp.c | |
parent | bb34acd8a41ac2302d2039b98a1dc2de8cbe7e8d (diff) | |
download | ffmpeg-c47b0738b559c3ded0e2941b89a970f54d73b283.tar.gz |
Check the URL used for the SDP destination.
Patch by Martin Storsjo (martin AT martin DOT st)
Originally committed as revision 21056 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/sdp.c')
-rw-r--r-- | libavformat/sdp.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libavformat/sdp.c b/libavformat/sdp.c index 2d42572589..c3ba3652dc 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <string.h> #include "libavutil/avstring.h" #include "libavutil/base64.h" #include "avformat.h" @@ -72,10 +73,19 @@ static int sdp_get_address(char *dest_addr, int size, int *ttl, const char *url) { int port; const char *p; + char proto[32]; - url_split(NULL, 0, NULL, 0, dest_addr, size, &port, NULL, 0, url); + url_split(proto, sizeof(proto), NULL, 0, dest_addr, size, &port, NULL, 0, url); *ttl = 0; + + if (strcmp(proto, "rtp")) { + /* The url isn't for the actual rtp sessions, + * don't parse out anything else than the destination. + */ + return 0; + } + p = strchr(url, '?'); if (p) { char buff[64]; |