summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-01-31 21:47:58 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-01-31 21:47:58 +0100
commitf607e5406666dbd1646b427af9b46c956829a773 (patch)
treed8e8987358c40b4e7317c99317a68bdbb86d2a5a
parent6aae848f1866a397004dbe7273f95910f0cf1b9f (diff)
downloaddabmod-f607e5406666dbd1646b427af9b46c956829a773.tar.gz
dabmod-f607e5406666dbd1646b427af9b46c956829a773.tar.bz2
dabmod-f607e5406666dbd1646b427af9b46c956829a773.zip
Correct size of PhaseReference d_dataIn
-rw-r--r--src/PhaseReference.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/PhaseReference.cpp b/src/PhaseReference.cpp
index 4e4e51a..d9d9efc 100644
--- a/src/PhaseReference.cpp
+++ b/src/PhaseReference.cpp
@@ -71,7 +71,7 @@ PhaseReference::PhaseReference(unsigned int dabmode) :
throw std::runtime_error(
"PhaseReference::PhaseReference DAB mode not valid!");
}
- d_dataIn.resize(d_num);
+ d_dataIn.resize(d_carriers);
fillData();
myOutputFormat.size(d_carriers * sizeof(complexf));
@@ -141,7 +141,12 @@ void PhaseReference::fillData()
"PhaseReference::fillData invalid DAB mode!");
}
- for (index = 0, offset = 0; index < d_carriers; ++offset) {
+ if (d_dataIn.size() != d_carriers) {
+ throw std::runtime_error(
+ "PhaseReference::fillData d_dataIn has incorrect size!");
+ }
+
+ for (index = 0, offset = 0; index < d_dataIn.size(); ++offset) {
for (k = 0; k < 32; ++k) {
d_dataIn[index++] = convert(d_h[table[d_dabmode][offset][0]][k]
+ table[d_dabmode][offset][1]);