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
6871c171
Commit
6871c171
authored
Sep 03, 2018
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/matroskadec: Simplify string length calculation.
FFmpeg relies on sizeof(char) == 1.
parent
10f46815
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
matroskadec.c
libavformat/matroskadec.c
+3
-3
No files found.
libavformat/matroskadec.c
View file @
6871c171
...
@@ -3931,11 +3931,11 @@ static int webm_dash_manifest_cues(AVFormatContext *s, int64_t init_range)
...
@@ -3931,11 +3931,11 @@ static int webm_dash_manifest_cues(AVFormatContext *s, int64_t init_range)
// store cue point timestamps as a comma separated list for checking subsegment alignment in
// store cue point timestamps as a comma separated list for checking subsegment alignment in
// the muxer. assumes that each timestamp cannot be more than 20 characters long.
// the muxer. assumes that each timestamp cannot be more than 20 characters long.
buf
=
av_malloc_array
(
s
->
streams
[
0
]
->
nb_index_entries
,
20
*
sizeof
(
char
)
);
buf
=
av_malloc_array
(
s
->
streams
[
0
]
->
nb_index_entries
,
20
);
if
(
!
buf
)
return
-
1
;
if
(
!
buf
)
return
-
1
;
strcpy
(
buf
,
""
);
strcpy
(
buf
,
""
);
for
(
i
=
0
;
i
<
s
->
streams
[
0
]
->
nb_index_entries
;
i
++
)
{
for
(
i
=
0
;
i
<
s
->
streams
[
0
]
->
nb_index_entries
;
i
++
)
{
int
ret
=
snprintf
(
buf
+
end
,
20
*
sizeof
(
char
)
,
int
ret
=
snprintf
(
buf
+
end
,
20
,
"%"
PRId64
,
s
->
streams
[
0
]
->
index_entries
[
i
].
timestamp
);
"%"
PRId64
,
s
->
streams
[
0
]
->
index_entries
[
i
].
timestamp
);
if
(
ret
<=
0
||
(
ret
==
20
&&
i
==
s
->
streams
[
0
]
->
nb_index_entries
-
1
))
{
if
(
ret
<=
0
||
(
ret
==
20
&&
i
==
s
->
streams
[
0
]
->
nb_index_entries
-
1
))
{
av_log
(
s
,
AV_LOG_ERROR
,
"timestamp too long.
\n
"
);
av_log
(
s
,
AV_LOG_ERROR
,
"timestamp too long.
\n
"
);
...
@@ -3944,7 +3944,7 @@ static int webm_dash_manifest_cues(AVFormatContext *s, int64_t init_range)
...
@@ -3944,7 +3944,7 @@ static int webm_dash_manifest_cues(AVFormatContext *s, int64_t init_range)
}
}
end
+=
ret
;
end
+=
ret
;
if
(
i
!=
s
->
streams
[
0
]
->
nb_index_entries
-
1
)
{
if
(
i
!=
s
->
streams
[
0
]
->
nb_index_entries
-
1
)
{
strncat
(
buf
,
","
,
sizeof
(
char
)
);
strncat
(
buf
,
","
,
1
);
end
++
;
end
++
;
}
}
}
}
...
...
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