*/
-#include "encode_server.h"
-#include "util.h"
-#include "dcpomatic_socket.h"
-#include "image.h"
-#include "dcp_video.h"
+#include "compose.hpp"
#include "config.h"
+#include "constants.h"
#include "cross.h"
-#include "player_video.h"
-#include "compose.hpp"
-#include "log.h"
+#include "dcp_video.h"
#include "dcpomatic_log.h"
+#include "dcpomatic_socket.h"
+#include "encode_server.h"
#include "encoded_log_entry.h"
+#include "image.h"
+#include "log.h"
+#include "player_video.h"
#include "version.h"
-#include "warnings.h"
#include <dcp/raw_convert.h>
+#include <dcp/warnings.h>
#include <libcxml/cxml.h>
-DCPOMATIC_DISABLE_WARNINGS
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
-DCPOMATIC_ENABLE_WARNINGS
+LIBDCP_ENABLE_WARNINGS
#include <boost/algorithm/string.hpp>
#include <boost/scoped_array.hpp>
#ifdef HAVE_VALGRIND_H
Socket::ReadDigestScope ds (socket);
auto length = socket->read_uint32 ();
+ if (length > 65536) {
+ throw NetworkError("Malformed encode request (too large)");
+ }
+
scoped_array<char> buffer (new char[length]);
socket->read (reinterpret_cast<uint8_t*>(buffer.get()), length);