mkvparser: validate results in EBMLHeader::Parse.

Return an error when DocType, DocTypeReadVersion, DocTypeVersion
EBMLMaxIDLength or EBMLMaxSizeLength are invalid or cannot be
handled by mkvparser.

Update samples to respect the return value from EBMLHeader::Parse.

BUG=https://code.google.com/p/webm/issues/detail?id=1057

Change-Id: I9337f13c1d5fa366b1101e48fe6bc46eb5b2ee97
This commit is contained in:
Tom Finegan
2015-09-04 10:18:20 -07:00
parent cec98d4110
commit 714f3c4e4f
4 changed files with 22 additions and 6 deletions

View File

@@ -345,7 +345,7 @@ bool vttdemux::ParseHeader(mkvparser::IMkvReader* reader, mkvpos_t* pos) {
return false;
}
if (strcmp(h.m_docType, "webm") != 0) {
if (h.m_docType == NULL || strcmp(h.m_docType, "webm") != 0) {
printf("bad doctype\n");
return false;
}