diff options
author | rtognimp <rtognimp@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-07-25 00:37:07 +0000 |
---|---|---|
committer | rtognimp <rtognimp@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-07-25 00:37:07 +0000 |
commit | ce1d9c664cc94c1d6d8b26a7e63ef5537db8bb15 (patch) | |
tree | 011330d234c5d2888c9a277d068f6aa04d42e821 /libmpdemux | |
parent | 8c838b7a1df84e7bfca9daeefbc9361bba595bdb (diff) | |
download | mpv-ce1d9c664cc94c1d6d8b26a7e63ef5537db8bb15.tar.bz2 mpv-ce1d9c664cc94c1d6d8b26a7e63ef5537db8bb15.tar.xz |
Fix segfault caused by changing a pointer that will be freed later
Patch by Martin Simmons ( vyslnqaaxytp at spammotel dot com )
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12895 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/network.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libmpdemux/network.c b/libmpdemux/network.c index fc2b59f721..447c0ca020 100644 --- a/libmpdemux/network.c +++ b/libmpdemux/network.c @@ -1023,6 +1023,7 @@ realrtsp_streaming_start( stream_t *stream ) { int fd; rtsp_session_t *rtsp; char *mrl; + char *file; int port; int redirected, temp; if( stream==NULL ) return -1; @@ -1037,11 +1038,12 @@ realrtsp_streaming_start( stream_t *stream ) { port = (stream->streaming_ctrl->url->port ? stream->streaming_ctrl->url->port : 554),1 ); if(fd<0) return -1; - mrl = malloc(sizeof(char)*(strlen(stream->streaming_ctrl->url->hostname)+strlen(stream->streaming_ctrl->url->file)+16)); - if (stream->streaming_ctrl->url->file[0] == '/') - stream->streaming_ctrl->url->file++; - sprintf(mrl,"rtsp://%s:%i/%s",stream->streaming_ctrl->url->hostname,port,stream->streaming_ctrl->url->file); - rtsp = rtsp_session_start(fd,&mrl, stream->streaming_ctrl->url->file, + file = stream->streaming_ctrl->url->file; + if (file[0] == '/') + file++; + mrl = malloc(sizeof(char)*(strlen(stream->streaming_ctrl->url->hostname)+strlen(file)+16)); + sprintf(mrl,"rtsp://%s:%i/%s",stream->streaming_ctrl->url->hostname,port,file); + rtsp = rtsp_session_start(fd,&mrl, file, stream->streaming_ctrl->url->hostname, port, &redirected); if ( redirected == 1 ) { |