1
0
Fork 0

enforce value constraints when reading stream

This commit is contained in:
Kevin Matz 2021-08-27 08:56:39 -04:00
parent f40ac836ce
commit 8c99f4ff1f
2 changed files with 6 additions and 7 deletions

View File

@ -40,6 +40,12 @@ void data_header::iStream(ACN::PDU::Stream stream)
*stream >> sequence_number;
*stream >> options;
*stream >> universe;
/// \cite sACN 6.2.3 E1.31 Data Packet: Priority
/// No priority outside the range of 0 to 200 shall be transmitted on
/// the network.
if (priority> 200)
stream->setstate(std::ios_base::failbit);
}

View File

@ -196,13 +196,6 @@ void Receiver::dataFrameHandler(ACN::PDU::Message<DATA::Pdu> frame) {
return;
auto universe = universes_.at(source->universe())->sourceUniverse(*source);
/// \cite sACN
/// 6.2.3 E1.31 Data Packet: Priority
/// No priority outside the range of 0 to 200 shall be transmitted on
/// the network.
if (source->priority() > 200)
frame->stream()->setstate(std::ios_base::failbit);
/// \cite sACN
/// 6.2.6 E1.31 Data Packet: Options
/// Preview_Data: Bit 7 (most significant bit)