summaryrefslogtreecommitdiffstats
path: root/src/fig
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2021-06-22 11:56:03 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2021-06-22 11:56:03 +0200
commitef28f42a0db7dffc7f790ca8be3642c59d723d53 (patch)
tree2769ccc57bbb1fa89b8a603e62f72c30dc5569b3 /src/fig
parent7d9b2ee5ae8db92f4e28296983d706593197239a (diff)
downloaddabmux-ef28f42a0db7dffc7f790ca8be3642c59d723d53.tar.gz
dabmux-ef28f42a0db7dffc7f790ca8be3642c59d723d53.tar.bz2
dabmux-ef28f42a0db7dffc7f790ca8be3642c59d723d53.zip
Fix crash when FIG0/7 doesn't have enough space
Diffstat (limited to 'src/fig')
-rw-r--r--src/fig/FIG0_7.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/fig/FIG0_7.cpp b/src/fig/FIG0_7.cpp
index 50a12cf..363fa65 100644
--- a/src/fig/FIG0_7.cpp
+++ b/src/fig/FIG0_7.cpp
@@ -49,6 +49,12 @@ FillStatus FIG0_7::fill(uint8_t *buf, size_t max_size)
{
FillStatus fs;
+ if (max_size < 4) {
+ fs.complete_fig_transmitted = false;
+ fs.num_bytes_written = 0;
+ return fs;
+ }
+
auto ensemble = m_rti->ensemble;
if (ensemble->reconfig_counter < 0) {