From 04609cd07dbb6be3993392a1e34885fd5c6656f6 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Thu, 10 May 2018 11:02:41 -0500 Subject: [PATCH] Check msg_queue size_tail_bytes existence of buffer --- lib/include/srslte/common/msg_queue.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/include/srslte/common/msg_queue.h b/lib/include/srslte/common/msg_queue.h index 8e73caa00..e3a86941d 100644 --- a/lib/include/srslte/common/msg_queue.h +++ b/lib/include/srslte/common/msg_queue.h @@ -131,7 +131,10 @@ public: uint32_t size_tail_bytes() { pthread_mutex_lock(&mutex); - uint32_t r = buf[tail]->N_bytes; + uint32_t r = 0; + if (buf[tail]) { + r = buf[tail]->N_bytes; + } pthread_mutex_unlock(&mutex); return r; }