From b4c0acad9cbd7e6516f64398e403e2ddf6ed52a8 Mon Sep 17 00:00:00 2001
From: Thomas Schlichter <thomas.schlichter@iis.fraunhofer.de>
Date: Wed, 3 Jul 2019 14:42:04 +0200
Subject: [PATCH] fix crashes in nr_ulsch_decoding

- initialize p_decParams->Z from harq_process not only in round 0
- do not set opp_enabled=1, this crashes in LDPC encoder
---
 openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
index 6ca27331204..1af31d77e9c 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
@@ -364,15 +364,15 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
                     &harq_process->Z, // [hna] Z is Zc
                     &harq_process->F);
 
-    p_decParams->Z = harq_process->Z;
-
 #ifdef DEBUG_ULSCH_DECODING
-    printf("ulsch decoding nr segmentation Z %d\n", p_decParams->Z);
+    printf("ulsch decoding nr segmentation Z %d\n", harq_process->Z);
     if (!frame%100)
-      printf("K %d C %d Z %d nl %d \n", harq_process->K, harq_process->C, p_decParams->Z, harq_process->Nl);
+      printf("K %d C %d Z %d nl %d \n", harq_process->K, harq_process->C, harq_process->Z, harq_process->Nl);
 #endif
   }
 
+  p_decParams->Z = harq_process->Z;
+
   Coderate = (float) A /(float) G;
 
   if ((A <=292) || ((A<=3824) && (Coderate <= 0.6667)) || Coderate <= 0.25){
@@ -436,7 +436,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
   printf("Segmentation: C %d, K %d\n",harq_process->C,harq_process->K);
 #endif
 
-  opp_enabled=1;
+  //opp_enabled=1;
 
   Kr = harq_process->K; // [hna] overwrites this line "Kr = p_decParams->Z*kb"
   Kr_bytes = Kr>>3;
-- 
GitLab