From ccd548a4ec01d1fbcc0f50d30f298893a02eee75 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 4 Dec 2009 11:05:42 +0100 Subject: [PATCH] Fix mandatory elements before writing a master to the file. Otherwise libebml might assert() because some mandatory elements are missing. This mostly happens with files not created by libebml itself, e.g. those by HandBrake. Fix for bug 445. --- src/common/kax_analyzer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common/kax_analyzer.cpp b/src/common/kax_analyzer.cpp index 2949e47d9..d44150b5c 100644 --- a/src/common/kax_analyzer.cpp +++ b/src/common/kax_analyzer.cpp @@ -302,6 +302,8 @@ kax_analyzer_c::read_element(kax_analyzer_data_c *element_data) { kax_analyzer_c::update_element_result_e kax_analyzer_c::update_element(EbmlElement *e, bool write_defaults) { + fix_mandatory_elements(e); + try { call_and_validate({}, "update_element_0"); call_and_validate(overwrite_all_instances(e->Generic().GlobalId), "update_element_1");