Commit f98cad87 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'b8d7f318'

* commit 'b8d7f318':
  matroskadec: fix crash when parsing invalid mkv
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 4c2b8867 b8d7f318
......@@ -2080,8 +2080,12 @@ static int matroska_read_header(AVFormatContext *s)
matroska->cues_parsing_deferred = 1;
/* First read the EBML header. */
if (ebml_parse(matroska, ebml_syntax, &ebml) ||
ebml.version > EBML_VERSION ||
if (ebml_parse(matroska, ebml_syntax, &ebml) || !ebml.doctype) {
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.id_length > sizeof(uint32_t) ||
ebml.doctype_version > 3 ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment