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
8fb22c3d
Commit
8fb22c3d
authored
Oct 13, 2011
by
Alex Converse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mov: Prevent illegal writes when chapter titles are very short.
parent
f492df09
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
mov.c
libavformat/mov.c
+15
-8
No files found.
libavformat/mov.c
View file @
8fb22c3d
...
...
@@ -2369,6 +2369,9 @@ static void mov_read_chapters(AVFormatContext *s)
// The samples could theoretically be in any encoding if there's an encd
// atom following, but in practice are only utf-8 or utf-16, distinguished
// instead by the presence of a BOM
if
(
!
len
)
{
title
[
0
]
=
0
;
}
else
{
ch
=
avio_rb16
(
sc
->
pb
);
if
(
ch
==
0xfeff
)
avio_get_str16be
(
sc
->
pb
,
len
,
title
,
title_len
);
...
...
@@ -2376,8 +2379,12 @@ static void mov_read_chapters(AVFormatContext *s)
avio_get_str16le
(
sc
->
pb
,
len
,
title
,
title_len
);
else
{
AV_WB16
(
title
,
ch
);
if
(
len
==
1
||
len
==
2
)
title
[
len
]
=
'0'
;
else
avio_get_str
(
sc
->
pb
,
len
-
2
,
title
+
2
,
title_len
-
2
);
}
}
ff_new_chapter
(
s
,
i
,
st
->
time_base
,
sample
->
timestamp
,
end
,
title
);
av_freep
(
&
title
);
...
...
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