Merge commit '3e1c9da38b849ce2982b516004370081fdd89ed0' into release/2.4
* commit '3e1c9da38b849ce2982b516004370081fdd89ed0':
matroskadec: fix crash when parsing invalid mkv
See: d9fe6b926c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -2013,12 +2013,15 @@ static int matroska_read_header(AVFormatContext *s)
|
|||||||
matroska->ctx = s;
|
matroska->ctx = s;
|
||||||
|
|
||||||
/* First read the EBML header. */
|
/* First read the EBML header. */
|
||||||
if (ebml_parse(matroska, ebml_syntax, &ebml) ||
|
if (ebml_parse(matroska, ebml_syntax, &ebml) || !ebml.doctype) {
|
||||||
ebml.version > EBML_VERSION ||
|
av_log(matroska->ctx, AV_LOG_ERROR, "EBML header parsing failed\n");
|
||||||
|
ebml_free(ebml_syntax, &ebml);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
if (ebml.version > EBML_VERSION ||
|
||||||
ebml.max_size > sizeof(uint64_t) ||
|
ebml.max_size > sizeof(uint64_t) ||
|
||||||
ebml.id_length > sizeof(uint32_t) ||
|
ebml.id_length > sizeof(uint32_t) ||
|
||||||
ebml.doctype_version > 3 ||
|
ebml.doctype_version > 3) {
|
||||||
!ebml.doctype) {
|
|
||||||
av_log(matroska->ctx, AV_LOG_ERROR,
|
av_log(matroska->ctx, AV_LOG_ERROR,
|
||||||
"EBML header using unsupported features\n"
|
"EBML header using unsupported features\n"
|
||||||
"(EBML version %"PRIu64", doctype %s, doc version %"PRIu64")\n",
|
"(EBML version %"PRIu64", doctype %s, doc version %"PRIu64")\n",
|
||||||
|
Reference in New Issue
Block a user