summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-12-16 10:00:59 +0000
committerCarl Hetherington <cth@carlh.net>2016-12-16 10:00:59 +0000
commit332ad44023ff81ae44b15f2587f4d40e4d5ccff5 (patch)
treed6655ea97087ded3113a3510ae6737ad403c971c /src
parente2060bab0a965e77dee7c998753a858aa38b8849 (diff)
Increase maximum allowable KDM file size.
Diffstat (limited to 'src')
-rw-r--r--src/lib/util.h2
-rw-r--r--src/tools/dcpomatic_kdm.cc2
-rw-r--r--src/wx/content_menu.cc2
3 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/util.h b/src/lib/util.h
index 5e1780d72..e163e1a8f 100644
--- a/src/lib/util.h
+++ b/src/lib/util.h
@@ -50,6 +50,8 @@ namespace dcp {
#define HISTORY_SIZE 10
#define REPORT_PROBLEM _("Please report this problem by using Help -> Report a problem or via email to carl@dcpomatic.com")
#define TEXT_FONT_ID "font"
+/** Largest KDM size (in bytes) that will be accepted */
+#define MAX_KDM_SIZE (256 * 1024)
extern std::string program_name;
diff --git a/src/tools/dcpomatic_kdm.cc b/src/tools/dcpomatic_kdm.cc
index a0d7c1cbc..a0a3a59f8 100644
--- a/src/tools/dcpomatic_kdm.cc
+++ b/src/tools/dcpomatic_kdm.cc
@@ -80,7 +80,7 @@ public:
optional<dcp::EncryptedKDM> get ()
{
try {
- return dcp::EncryptedKDM (dcp::file_to_string (wx_to_std (_dialog->GetPath ())));
+ return dcp::EncryptedKDM (dcp::file_to_string (wx_to_std (_dialog->GetPath ()), MAX_KDM_SIZE));
} catch (cxml::Error& e) {
error_dialog (_parent, wxString::Format ("This file does not look like a KDM (%s)", std_to_wx (e.what()).data()));
}
diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc
index 6da219f0f..0240a8c33 100644
--- a/src/wx/content_menu.cc
+++ b/src/wx/content_menu.cc
@@ -367,7 +367,7 @@ ContentMenu::kdm ()
if (d->ShowModal() == wxID_OK) {
try {
- dcp->add_kdm (dcp::EncryptedKDM (dcp::file_to_string (wx_to_std (d->GetPath ()))));
+ dcp->add_kdm (dcp::EncryptedKDM (dcp::file_to_string (wx_to_std (d->GetPath ()), MAX_KDM_SIZE)));
} catch (exception& e) {
error_dialog (_parent, wxString::Format (_("Could not load KDM (%s)"), e.what ()));
d->Destroy ();