mkvinfo: test returned element to be an instance of EbmlHead

See #1089.
This commit is contained in:
Moritz Bunkus 2014-12-18 23:39:03 +01:00
parent 563be4d698
commit 8415af3cd1
2 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2014-12-18 Moritz Bunkus <moritz@bunkus.org>
* 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.

View File

@ -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<EbmlHead>(l0)) {
show_error(Y("No EBML head found."));
delete es;