diff --git a/ChangeLog b/ChangeLog index 38e521c5a..f05e9cdea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2015-12-30 Moritz Bunkus + * mkvpropedit: bug fix: when changing the track language it is now + verified to be a valid ISO 639-2 language code before writing it + to the file. Fixes #1550. + * mkvmerge: enhancement: the MP4 reader will keep the display dimensions from the track header atom ("tkhd") and use them as the display width & height. See also #1547. diff --git a/src/propedit/change.cpp b/src/propedit/change.cpp index a7ef5f973..8264d3c64 100644 --- a/src/propedit/change.cpp +++ b/src/propedit/change.cpp @@ -20,6 +20,8 @@ #include "common/common_pch.h" #include "common/ebml.h" +#include "common/iso639.h" +#include "common/list_utils.h" #include "common/output.h" #include "common/strings/editing.h" #include "common/strings/parsing.h" @@ -276,5 +278,10 @@ change_c::parse_spec(change_c::change_type_e type, if (name.empty()) throw std::runtime_error(Y("missing property name")); + if ( mtx::included_in(type, ct_add, ct_set) + && (name == "language") + && !is_valid_iso639_2_code(value)) + throw std::runtime_error{(boost::format(("invalid ISO 639-2 language code '%1%'")) % value).str()}; + return std::make_shared(type, name, value); }