enforce value constraints when reading stream
This commit is contained in:
parent
f40ac836ce
commit
8c99f4ff1f
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue