Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
mediastreamer2
Commits
2337e4db
Commit
2337e4db
authored
Aug 19, 2015
by
François Grisez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix crash when mkvstream read a MKV files which some non-mandatory field are not written
parent
7ddbbace
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/utils/mkv_reader.c
src/utils/mkv_reader.c
+3
-3
No files found.
src/utils/mkv_reader.c
View file @
2337e4db
...
...
@@ -328,7 +328,7 @@ static void _load_modules(nodemodule *modules) {
static
int
_parse_headers
(
MKVReader
*
obj
)
{
ebml_element
*
level0
=
NULL
,
*
level1
=
NULL
;
ebml_parser_context
pctx
,
seg_pctx
;
char
doc_type
[
MAX_MKV_STRING_LENGTH
];
char
doc_type
[
9
];
int
doc_type_version
;
int
err
;
int
upper_level
=
0
;
...
...
@@ -359,13 +359,13 @@ static int _parse_headers(MKVReader *obj) {
ms_error
(
"MKVParser: missing elements in the EBML header"
);
goto
fail
;
}
EBML_StringGet
((
ebml_string
*
)
EBML_Master
Find
Child
((
ebml_master
*
)
level0
,
&
EBML_ContextDocType
),
doc_type
,
MAX_MKV_STRING_LENGTH
);
EBML_StringGet
((
ebml_string
*
)
EBML_Master
Get
Child
((
ebml_master
*
)
level0
,
&
EBML_ContextDocType
),
doc_type
,
sizeof
(
doc_type
)
);
err
=
strcmp
(
doc_type
,
"matroska"
);
if
(
err
!=
0
)
{
ms_error
(
"MKVParser: not a matroska file"
);
goto
fail
;
}
doc_type_version
=
EBML_IntegerValue
((
ebml_integer
*
)
EBML_Master
Find
Child
((
ebml_master
*
)
level0
,
&
EBML_ContextDocTypeVersion
));
doc_type_version
=
EBML_IntegerValue
((
ebml_integer
*
)
EBML_Master
Get
Child
((
ebml_master
*
)
level0
,
&
EBML_ContextDocTypeVersion
));
NodeDelete
((
node
*
)
level0
);
level0
=
EBML_FindNextElement
(
obj
->
file
,
&
pctx
,
&
upper_level
,
FALSE
);
...
...
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