aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-06 16:44:34 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-05-06 16:46:59 +0200
commitb34afd94ec908c051e1d76be331544e9f425bdcf (patch)
tree8702a4c008b513ab4c12fdda28657be0f8b148d0
parent1c14b09caf903f2e776dcd661085db49511bf531 (diff)
parentbac0850fbf870d4354d0f68840c0b1c9c1425c4a (diff)
downloadffmpeg-b34afd94ec908c051e1d76be331544e9f425bdcf.tar.gz
Merge commit 'bac0850fbf870d4354d0f68840c0b1c9c1425c4a' into release/2.2
* commit 'bac0850fbf870d4354d0f68840c0b1c9c1425c4a': matroskadec: fix crash when parsing invalid mkv Conflicts: libavformat/matroskadec.c See: d9fe6b926cd619c311e45e0ae352cf09713c482c Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/matroskadec.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 060e1a486e..e04122b7f2 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1547,9 +1547,13 @@ static int matroska_read_header(AVFormatContext *s)
matroska->ctx = s;
/* First read the EBML header. */
- if (ebml_parse(matroska, ebml_syntax, &ebml)
- || ebml.version > EBML_VERSION || ebml.max_size > sizeof(uint64_t)
- || ebml.id_length > sizeof(uint32_t) || ebml.doctype_version > 3 || !ebml.doctype) {
+ 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) {
av_log(matroska->ctx, AV_LOG_ERROR,
"EBML header using unsupported features\n"
"(EBML version %"PRIu64", doctype %s, doc version %"PRIu64")\n",