aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/dabOutput/edi/TagItems.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/dabOutput/edi/TagItems.cpp b/src/dabOutput/edi/TagItems.cpp
index afc45a8..1ea7080 100644
--- a/src/dabOutput/edi/TagItems.cpp
+++ b/src/dabOutput/edi/TagItems.cpp
@@ -145,6 +145,17 @@ std::vector<uint8_t> TagESTn::Assemble()
packet.push_back(0);
packet.push_back(0);
+ if (tpl > 0x3F) {
+ throw std::runtime_error("TagESTn: invalid TPL value");
+ }
+
+ if (sad > 0x3FF) {
+ throw std::runtime_error("TagESTn: invalid SAD value");
+ }
+
+ if (scid > 0x3F) {
+ throw std::runtime_error("TagESTn: invalid SCID value");
+ }
uint32_t sstc = (scid << 18) | (sad << 8) | (tpl << 2) | rfa;
packet.push_back((sstc >> 16) & 0xFF);