Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
ffmpeg2theora
Commits
0ba77657
Commit
0ba77657
authored
May 31, 2009
by
oggk
Browse files
prevent dereferencing NULL if malloc returns NULL (blah blah MMU anyway blah)
parent
32ad71c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ffmpeg2theora.c
View file @
0ba77657
...
...
@@ -1263,20 +1263,26 @@ void ff2theora_output(ff2theora this) {
// SSA has control stuff in there, extract raw text
if
(
enc
->
codec_id
==
CODEC_ID_SSA
)
{
char
*
dupe
=
malloc
(
utf8len
+
1
);
// not zero terminated, so make it so
memcpy
(
dupe
,
utf8
,
utf8len
);
dupe
[
utf8len
]
=
0
;
duration
=
get_duration_from_ssa
(
dupe
);
allocated_utf8
=
get_raw_text_from_ssa
(
dupe
);
if
(
allocated_utf8
)
{
if
(
allocated_utf8
==
dupe
)
{
allocated_utf8
=
NULL
;
}
else
{
utf8
=
allocated_utf8
;
utf8len
=
strlen
(
utf8
);
if
(
dupe
)
{
memcpy
(
dupe
,
utf8
,
utf8len
);
dupe
[
utf8len
]
=
0
;
duration
=
get_duration_from_ssa
(
dupe
);
allocated_utf8
=
get_raw_text_from_ssa
(
dupe
);
if
(
allocated_utf8
)
{
if
(
allocated_utf8
==
dupe
)
{
allocated_utf8
=
NULL
;
}
else
{
utf8
=
allocated_utf8
;
utf8len
=
strlen
(
utf8
);
}
}
free
(
dupe
);
}
else
{
utf8
=
NULL
;
utf8len
=
0
;
}
free
(
dupe
);
}
if
(
t
<
0
&&
t
+
duration
>
0
)
{
duration
+=
t
;
...
...
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