1
0
Fork 0

fail on receiving invalid universe number

This commit is contained in:
Kevin Matz 2021-08-28 10:27:13 -04:00
parent c808341eff
commit 39cb36c46e
2 changed files with 7 additions and 1 deletions

View File

@ -45,7 +45,13 @@ void data_header::iStream(ACN::PDU::Stream stream)
*stream >> sync_address;
*stream >> sequence_number;
*stream >> options;
/// \cite sACN 6.2.7 E1.31 Data Packet: Universe
///
/// Universe values shall be limited to the range 1 to 63999.
*stream >> universe;
if ((universe == 0) ||
(universe >= 64000 && universe != E131_DISCOVERY_UNIVERSE))
stream->setstate(std::ios_base::failbit);
}

View File

@ -103,7 +103,7 @@ TEST_F(sACNdataTest, stream_in) {
e131_data[108] = priority;
// Universe
uint16_t univ = 64000;
uint16_t univ = 63999;
e131_data[113] = univ >> 8; // high
e131_data[114] = univ & 0xff; // low
node.subscribe(univ);