mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-29 06:15:24 +00:00
mkvpropedit: verify given track language to be a ISO 639-2 code
Fixes #1550.
This commit is contained in:
parent
72527c3998
commit
4ef49467e0
@ -1,5 +1,9 @@
|
|||||||
2015-12-30 Moritz Bunkus <moritz@bunkus.org>
|
2015-12-30 Moritz Bunkus <moritz@bunkus.org>
|
||||||
|
|
||||||
|
* 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
|
* mkvmerge: enhancement: the MP4 reader will keep the display
|
||||||
dimensions from the track header atom ("tkhd") and use them as the
|
dimensions from the track header atom ("tkhd") and use them as the
|
||||||
display width & height. See also #1547.
|
display width & height. See also #1547.
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
#include "common/common_pch.h"
|
#include "common/common_pch.h"
|
||||||
#include "common/ebml.h"
|
#include "common/ebml.h"
|
||||||
|
#include "common/iso639.h"
|
||||||
|
#include "common/list_utils.h"
|
||||||
#include "common/output.h"
|
#include "common/output.h"
|
||||||
#include "common/strings/editing.h"
|
#include "common/strings/editing.h"
|
||||||
#include "common/strings/parsing.h"
|
#include "common/strings/parsing.h"
|
||||||
@ -276,5 +278,10 @@ change_c::parse_spec(change_c::change_type_e type,
|
|||||||
if (name.empty())
|
if (name.empty())
|
||||||
throw std::runtime_error(Y("missing property name"));
|
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<change_c>(type, name, value);
|
return std::make_shared<change_c>(type, name, value);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user