Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
ee44cb3c
Commit
ee44cb3c
authored
Aug 09, 2015
by
Mariusz Szczepańczyk
Committed by
Michael Niedermayer
Aug 10, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/ftp: properly read an empty path
Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
bc930531
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
ftp.c
libavformat/ftp.c
+8
-10
No files found.
libavformat/ftp.c
View file @
ee44cb3c
...
...
@@ -354,10 +354,7 @@ static int ftp_current_dir(FTPContext *s)
if
(
!
end
)
goto
fail
;
if
(
end
>
res
&&
end
[
-
1
]
==
'/'
)
{
end
[
-
1
]
=
'\0'
;
}
else
*
end
=
'\0'
;
*
end
=
'\0'
;
s
->
path
=
av_strdup
(
start
);
av_free
(
res
);
...
...
@@ -605,9 +602,8 @@ static int ftp_connect(URLContext *h, const char *url)
{
char
proto
[
10
],
path
[
MAX_URL_SIZE
],
credencials
[
MAX_URL_SIZE
],
hostname
[
MAX_URL_SIZE
];
const
char
*
tok_user
=
NULL
,
*
tok_pass
=
NULL
;
char
*
end
=
NULL
;
char
*
end
=
NULL
,
*
newpath
=
NULL
;
int
err
;
size_t
pathlen
;
FTPContext
*
s
=
h
->
priv_data
;
s
->
state
=
DISCONNECTED
;
...
...
@@ -642,10 +638,12 @@ static int ftp_connect(URLContext *h, const char *url)
if
((
err
=
ftp_current_dir
(
s
))
<
0
)
return
err
;
pathlen
=
strlen
(
s
->
path
)
+
strlen
(
path
)
+
1
;
if
((
err
=
av_reallocp
(
&
s
->
path
,
pathlen
))
<
0
)
return
err
;
av_strlcat
(
s
->
path
+
strlen
(
s
->
path
),
path
,
pathlen
);
newpath
=
av_append_path_component
(
s
->
path
,
path
);
if
(
!
newpath
)
return
AVERROR
(
ENOMEM
);
av_free
(
s
->
path
);
s
->
path
=
newpath
;
return
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment