projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add missing file=f so that all desktop shortcuts are uninstalled.
[dcpomatic.git]
/
src
/
lib
/
encode_server.cc
diff --git
a/src/lib/encode_server.cc
b/src/lib/encode_server.cc
index d326c767be226aa240255504354a4ae08a33ef75..036ea58a5df92b94cb5cde24e6a7666be195f3a4 100644
(file)
--- a/
src/lib/encode_server.cc
+++ b/
src/lib/encode_server.cc
@@
-25,18
+25,18
@@
*/
*/
-#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 "config.h"
+#include "constants.h"
#include "cross.h"
#include "cross.h"
-#include "player_video.h"
-#include "compose.hpp"
-#include "log.h"
+#include "dcp_video.h"
#include "dcpomatic_log.h"
#include "dcpomatic_log.h"
+#include "dcpomatic_socket.h"
+#include "encode_server.h"
#include "encoded_log_entry.h"
#include "encoded_log_entry.h"
+#include "image.h"
+#include "log.h"
+#include "player_video.h"
#include "version.h"
#include <dcp/raw_convert.h>
#include <dcp/warnings.h>
#include "version.h"
#include <dcp/raw_convert.h>
#include <dcp/warnings.h>
@@
-126,6
+126,10
@@
EncodeServer::process (shared_ptr<Socket> socket, struct timeval& after_read, st
Socket::ReadDigestScope ds (socket);
auto length = socket->read_uint32 ();
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);
scoped_array<char> buffer (new char[length]);
socket->read (reinterpret_cast<uint8_t*>(buffer.get()), length);