summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/input/Zmq.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/input/Zmq.cpp b/src/input/Zmq.cpp
index 1ba994e..1dd49af 100644
--- a/src/input/Zmq.cpp
+++ b/src/input/Zmq.cpp
@@ -2,7 +2,7 @@
Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
Research Center Canada)
- Copyright (C) 2017 Matthias P. Braendli
+ Copyright (C) 2018 Matthias P. Braendli
http://www.opendigitalradio.org
ZeroMQ input. see www.zeromq.org for more info
@@ -360,7 +360,8 @@ int ZmqMPEG::readFromSocket(size_t framesize)
/* Look for the new zmq_frame_header_t format */
zmq_frame_header_t* frame = (zmq_frame_header_t*)msg.data();
- if (msg.size() == ZMQ_FRAME_SIZE(frame) and
+ if ( msg.size() >= sizeof(zmq_frame_header_t) and
+ msg.size() == ZMQ_FRAME_SIZE(frame) and
frame->version == 1 and
frame->encoder == ZMQ_ENCODER_TOOLAME) {
datalen = frame->datasize;
@@ -429,7 +430,8 @@ int ZmqAAC::readFromSocket(size_t framesize)
/* Look for the new zmq_frame_header_t format */
zmq_frame_header_t* frame = (zmq_frame_header_t*)msg.data();
- if (msg.size() == ZMQ_FRAME_SIZE(frame) and
+ if ( msg.size() >= sizeof(zmq_frame_header_t) and
+ msg.size() == ZMQ_FRAME_SIZE(frame) and
frame->version == 1 and
frame->encoder == ZMQ_ENCODER_FDK) {
datalen = frame->datasize;