aboutsummaryrefslogtreecommitdiffstats
path: root/src/ConvEncoder.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-02-12 17:51:48 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-02-12 17:51:48 +0100
commit6eb9a403558d4dfde1de36e5c6744b58dc26ea79 (patch)
tree60f35619167d007ab7ef3a3af3573d3a9c8e8501 /src/ConvEncoder.cpp
parente659399f872832552a5fdae02e70f4579f0e266e (diff)
downloaddabmod-6eb9a403558d4dfde1de36e5c6744b58dc26ea79.tar.gz
dabmod-6eb9a403558d4dfde1de36e5c6744b58dc26ea79.tar.bz2
dabmod-6eb9a403558d4dfde1de36e5c6744b58dc26ea79.zip
Fix incorrect frame size bug due to missing puncturing padding
Diffstat (limited to 'src/ConvEncoder.cpp')
-rw-r--r--src/ConvEncoder.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ConvEncoder.cpp b/src/ConvEncoder.cpp
index 74de34f..06b2e85 100644
--- a/src/ConvEncoder.cpp
+++ b/src/ConvEncoder.cpp
@@ -111,6 +111,7 @@ int ConvEncoder::process(Buffer* const dataIn, Buffer* dataOut)
}
++in_offset;
}
+
for (unsigned pad_count = 0; pad_count < 3; ++pad_count) {
out[out_offset] = 0;
// For each 4-bit output word
@@ -138,5 +139,11 @@ int ConvEncoder::process(Buffer* const dataIn, Buffer* dataOut)
PDEBUG(" Consume: %zu\n", in_offset);
PDEBUG(" Return: %zu\n", out_offset);
+
+ if (out_offset != dataOut->getLength()) {
+ throw std::runtime_error("Assertion error: ConvEncoder output " +
+ std::to_string(out_offset) + " == " +
+ std::to_string(dataOut->getLength()) + " fail");
+ }
return out_offset;
}