Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
de16d374
Commit
de16d374
authored
Dec 09, 2013
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: flac: align to avoid overflow on seek (fix #10000)
Align seek time on second to avoid overflow on seek.
parent
4d65e300
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
modules/demux/flac.c
modules/demux/flac.c
+8
-2
No files found.
modules/demux/flac.c
View file @
de16d374
...
@@ -312,6 +312,7 @@ static int ControlSetTime( demux_t *p_demux, int64_t i_time )
...
@@ -312,6 +312,7 @@ static int ControlSetTime( demux_t *p_demux, int64_t i_time )
int64_t
i_delta_offset
;
int64_t
i_delta_offset
;
int64_t
i_next_time
;
int64_t
i_next_time
;
int64_t
i_next_offset
;
int64_t
i_next_offset
;
uint32_t
i_time_align
=
1
;
if
(
i
+
1
<
p_sys
->
i_seekpoint
)
if
(
i
+
1
<
p_sys
->
i_seekpoint
)
{
{
...
@@ -325,14 +326,19 @@ static int ControlSetTime( demux_t *p_demux, int64_t i_time )
...
@@ -325,14 +326,19 @@ static int ControlSetTime( demux_t *p_demux, int64_t i_time )
}
}
i_delta_offset
=
0
;
i_delta_offset
=
0
;
if
(
INT64_MAX
/
i_delta_time
<
(
i_next_offset
-
p_sys
->
seekpoint
[
i
]
->
i_byte_offset
)
)
i_time_align
=
1000000
;
if
(
i_next_time
-
p_sys
->
seekpoint
[
i
]
->
i_time_offset
>
0
)
if
(
i_next_time
-
p_sys
->
seekpoint
[
i
]
->
i_time_offset
>
0
)
i_delta_offset
=
(
i_next_offset
-
p_sys
->
seekpoint
[
i
]
->
i_byte_offset
)
*
i_delta_time
/
i_delta_offset
=
(
i_next_offset
-
p_sys
->
seekpoint
[
i
]
->
i_byte_offset
)
*
(
i_delta_time
/
i_time_align
)
/
(
i_next_time
-
p_sys
->
seekpoint
[
i
]
->
i_time_offset
);
(
(
i_next_time
-
p_sys
->
seekpoint
[
i
]
->
i_time_offset
)
/
i_time_align
);
if
(
stream_Seek
(
p_demux
->
s
,
p_sys
->
seekpoint
[
i
]
->
i_byte_offset
+
p_sys
->
i_data_pos
+
i_delta_offset
)
)
if
(
stream_Seek
(
p_demux
->
s
,
p_sys
->
seekpoint
[
i
]
->
i_byte_offset
+
p_sys
->
i_data_pos
+
i_delta_offset
)
)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
p_sys
->
i_pts_start
=
p_sys
->
i_pts
;
p_sys
->
i_pts_start
=
p_sys
->
i_pts
;
i_delta_time
=
(
i_delta_time
/
i_time_align
)
*
i_time_align
;
p_sys
->
i_time_offset
=
(
p_sys
->
seekpoint
[
i
]
->
i_time_offset
+
i_delta_time
)
-
p_sys
->
i_pts
;
p_sys
->
i_time_offset
=
(
p_sys
->
seekpoint
[
i
]
->
i_time_offset
+
i_delta_time
)
-
p_sys
->
i_pts
;
}
}
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
...
...
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