From 8415af3cd185d9fe793d32d1dc548ed680682ffa Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 18 Dec 2014 23:39:03 +0100 Subject: [PATCH] mkvinfo: test returned element to be an instance of EbmlHead See #1089. --- ChangeLog | 3 +++ src/info/mkvinfo.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4ff269042..f09dfa0ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2014-12-18 Moritz Bunkus + * mkvinfo: bug fix: mkvinfo will abort with a proper error message + if the first element found is not an EBML head element. See #1089. + * all: enhancement: improved exception messages that can occur when reading damaged Matroska files to make it clearer for the user what's happening. See #1089. diff --git a/src/info/mkvinfo.cpp b/src/info/mkvinfo.cpp index 164437246..809a78f0b 100644 --- a/src/info/mkvinfo.cpp +++ b/src/info/mkvinfo.cpp @@ -1630,7 +1630,7 @@ process_file(const std::string &file_name) { // Find the EbmlHead element. Must be the first one. l0 = es->FindNextID(EBML_INFO(EbmlHead), 0xFFFFFFFFL); - if (!l0) { + if (!l0 || !Is(l0)) { show_error(Y("No EBML head found.")); delete es;