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
928cfc7e
Commit
928cfc7e
authored
Sep 14, 2011
by
Joakim Plate
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ffmdec] Check return value of avio_seek and avoid modifying state if it fails
parent
1df00ac8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
ffmdec.c
libavformat/ffmdec.c
+4
-3
No files found.
libavformat/ffmdec.c
View file @
928cfc7e
...
...
@@ -171,7 +171,7 @@ static int ffm_read_data(AVFormatContext *s,
/* ensure that acutal seeking happens between FFM_PACKET_SIZE
and file_size - FFM_PACKET_SIZE */
static
void
ffm_seek1
(
AVFormatContext
*
s
,
int64_t
pos1
)
static
int64_t
ffm_seek1
(
AVFormatContext
*
s
,
int64_t
pos1
)
{
FFMContext
*
ffm
=
s
->
priv_data
;
AVIOContext
*
pb
=
s
->
pb
;
...
...
@@ -180,7 +180,7 @@ static void ffm_seek1(AVFormatContext *s, int64_t pos1)
pos
=
FFMIN
(
pos1
,
ffm
->
file_size
-
FFM_PACKET_SIZE
);
pos
=
FFMAX
(
pos
,
FFM_PACKET_SIZE
);
av_dlog
(
s
,
"seek to %"
PRIx64
" -> %"
PRIx64
"
\n
"
,
pos1
,
pos
);
avio_seek
(
pb
,
pos
,
SEEK_SET
);
return
avio_seek
(
pb
,
pos
,
SEEK_SET
);
}
static
int64_t
get_dts
(
AVFormatContext
*
s
,
int64_t
pos
)
...
...
@@ -506,7 +506,8 @@ static int ffm_seek(AVFormatContext *s, int stream_index, int64_t wanted_pts, in
pos
=
(
flags
&
AVSEEK_FLAG_BACKWARD
)
?
pos_min
:
pos_max
;
found:
ffm_seek1
(
s
,
pos
);
if
(
ffm_seek1
(
s
,
pos
)
<
0
)
return
-
1
;
/* reset read state */
ffm
->
read_state
=
READ_HEADER
;
...
...
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