discard packet if incomplete #13
This commit is contained in:
parent
418d08bc7a
commit
19c97fb4d9
3
Artnet.h
3
Artnet.h
@ -249,10 +249,11 @@ namespace arx {
|
|||||||
|
|
||||||
bool parse() {
|
bool parse() {
|
||||||
const size_t size = stream->parsePacket();
|
const size_t size = stream->parsePacket();
|
||||||
if (size <= HEADER_SIZE) return false;
|
if (size == 0) return false;
|
||||||
|
|
||||||
uint8_t d[size];
|
uint8_t d[size];
|
||||||
stream->read(d, size);
|
stream->read(d, size);
|
||||||
|
if (size <= HEADER_SIZE) return false; // discard packet if incomplete
|
||||||
|
|
||||||
if (checkID(d)) {
|
if (checkID(d)) {
|
||||||
if (opcode(d) == OPC(OpCode::Dmx)) {
|
if (opcode(d) == OPC(OpCode::Dmx)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user