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
a96b39de
Commit
a96b39de
authored
Oct 20, 2012
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/srtdec: simplify start/end computation.
Also fix potential overflow (CID733778)
parent
a945607a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
srtdec.c
libavformat/srtdec.c
+7
-10
No files found.
libavformat/srtdec.c
View file @
a96b39de
...
...
@@ -53,19 +53,16 @@ static int srt_read_header(AVFormatContext *s)
static
int64_t
get_pts
(
const
char
*
buf
,
int
*
duration
)
{
int
i
,
hour
,
min
,
sec
,
hsec
;
int
he
,
me
,
se
,
mse
;
int
i
;
for
(
i
=
0
;
i
<
2
;
i
++
)
{
int64_t
start
,
end
;
int
hh1
,
mm1
,
ss1
,
ms1
;
int
hh2
,
mm2
,
ss2
,
ms2
;
if
(
sscanf
(
buf
,
"%d:%2d:%2d%*1[,.]%3d --> %d:%2d:%2d%*1[,.]%3d"
,
&
hour
,
&
min
,
&
sec
,
&
hsec
,
&
he
,
&
me
,
&
se
,
&
mse
)
==
8
)
{
min
+=
60
*
hour
;
sec
+=
60
*
min
;
start
=
sec
*
1000
+
hsec
;
me
+=
60
*
he
;
se
+=
60
*
me
;
end
=
se
*
1000
+
mse
;
&
hh1
,
&
mm1
,
&
ss1
,
&
ms1
,
&
hh2
,
&
mm2
,
&
ss2
,
&
ms2
)
==
8
)
{
int64_t
start
=
(
hh1
*
3600LL
+
mm1
*
60LL
+
ss1
)
*
1000LL
+
ms1
;
int64_t
end
=
(
hh2
*
3600LL
+
mm2
*
60LL
+
ss2
)
*
1000LL
+
ms2
;
*
duration
=
end
-
start
;
return
start
;
}
...
...
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