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
9f4b55ef
Commit
9f4b55ef
authored
Feb 27, 2014
by
Lukasz Marek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/ftp: fix seek to nagative position
Signed-off-by:
Lukasz Marek
<
lukasz.m.luki@gmail.com
>
parent
0025f130
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
ftp.c
libavformat/ftp.c
+5
-3
No files found.
libavformat/ftp.c
View file @
9f4b55ef
...
...
@@ -575,10 +575,12 @@ static int64_t ftp_seek(URLContext *h, int64_t pos, int whence)
if
(
h
->
is_streamed
)
return
AVERROR
(
EIO
);
/* XXX: Simulate behaviour of lseek in file protocol, which could be treated as a reference */
new_pos
=
FFMAX
(
0
,
new_pos
);
fake_pos
=
s
->
filesize
!=
-
1
?
FFMIN
(
new_pos
,
s
->
filesize
)
:
new_pos
;
if
(
new_pos
<
0
)
{
av_log
(
h
,
AV_LOG_ERROR
,
"Seeking to nagative position.
\n
"
);
return
AVERROR
(
EINVAL
);
}
fake_pos
=
s
->
filesize
!=
-
1
?
FFMIN
(
new_pos
,
s
->
filesize
)
:
new_pos
;
if
(
fake_pos
!=
s
->
position
)
{
if
((
err
=
ftp_abort
(
h
))
<
0
)
return
err
;
...
...
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