diff --git a/lib/decode_mac.cc b/lib/decode_mac.cc index a792b7c..3f64cfd 100644 --- a/lib/decode_mac.cc +++ b/lib/decode_mac.cc @@ -162,8 +162,8 @@ public: { int n_cbps = d_ofdm.n_cbps; - int first[n_cbps]; - int second[n_cbps]; + int first[MAX_BITS_PER_SYM]; + int second[MAX_BITS_PER_SYM]; int s = std::max(d_ofdm.n_bpsc / 2, 1); for (int j = 0; j < n_cbps; j++) { diff --git a/lib/utils.cc b/lib/utils.cc index 0561ff7..952d1c0 100644 --- a/lib/utils.cc +++ b/lib/utils.cc @@ -224,8 +224,8 @@ void interleave( { int n_cbps = ofdm.n_cbps; - int first[n_cbps]; - int second[n_cbps]; + int first[MAX_BITS_PER_SYM]; + int second[MAX_BITS_PER_SYM]; int s = std::max(ofdm.n_bpsc / 2, 1); for (int j = 0; j < n_cbps; j++) { diff --git a/lib/utils.h b/lib/utils.h index f769eed..d1481b8 100644 --- a/lib/utils.h +++ b/lib/utils.h @@ -28,7 +28,8 @@ using gr::ieee802_11::Encoding; #define MAX_PAYLOAD_SIZE 1500 #define MAX_PSDU_SIZE (MAX_PAYLOAD_SIZE + 28) // MAC, CRC #define MAX_SYM (((16 + 8 * MAX_PSDU_SIZE + 6) / 24) + 1) -#define MAX_ENCODED_BITS ((16 + 8 * MAX_PSDU_SIZE + 6) * 2 + 288) +#define MAX_BITS_PER_SYM 288 +#define MAX_ENCODED_BITS ((16 + 8 * MAX_PSDU_SIZE + 6) * 2 + MAX_BITS_PER_SYM) #define dout d_debug&& std::cout #define mylog(msg) \