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
860a0810
Commit
860a0810
authored
Sep 08, 2013
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/assenc: fix potential overread.
parent
378a830e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
assenc.c
libavcodec/assenc.c
+10
-3
No files found.
libavcodec/assenc.c
View file @
860a0810
...
@@ -80,9 +80,16 @@ static int ass_encode_frame(AVCodecContext *avctx,
...
@@ -80,9 +80,16 @@ static int ass_encode_frame(AVCodecContext *avctx,
* will be "Marked=N" instead of the layer num, so we will
* will be "Marked=N" instead of the layer num, so we will
* have layer=0, which is fine. */
* have layer=0, which is fine. */
layer
=
strtol
(
ass
,
&
p
,
10
);
layer
=
strtol
(
ass
,
&
p
,
10
);
if
(
*
p
)
p
+=
strcspn
(
p
,
","
)
+
1
;
// skip layer or marked
if
(
*
p
)
p
+=
strcspn
(
p
,
","
)
+
1
;
// skip start timestamp
#define SKIP_ENTRY(ptr) do { \
if
(
*
p
)
p
+=
strcspn
(
p
,
","
)
+
1
;
// skip end timestamp
char *sep = strchr(ptr, ','); \
if (sep) \
ptr = sep + 1; \
} while (0)
SKIP_ENTRY
(
p
);
// skip layer or marked
SKIP_ENTRY
(
p
);
// skip start timestamp
SKIP_ENTRY
(
p
);
// skip end timestamp
snprintf
(
ass_line
,
sizeof
(
ass_line
),
"%d,%ld,%s"
,
++
s
->
id
,
layer
,
p
);
snprintf
(
ass_line
,
sizeof
(
ass_line
),
"%d,%ld,%s"
,
++
s
->
id
,
layer
,
p
);
ass_line
[
strcspn
(
ass_line
,
"
\r\n
"
)]
=
0
;
ass_line
[
strcspn
(
ass_line
,
"
\r\n
"
)]
=
0
;
ass
=
ass_line
;
ass
=
ass_line
;
...
...
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