summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-03-26 20:52:45 +0200
committerHarald Welte <laforge@gnumonks.org>2018-03-26 23:07:24 +0200
commit055660098c148532ccaf499e24f227d5e8a866fb (patch)
treeed5cbea2c9dca51c13a05331599d537d3c66da79
parent9edea88b8051f38592da9bde27ad9934debe22b3 (diff)
MNCC_EncDec.cc: Fix decoding of speech versions in bearer capabilities
-rw-r--r--library/MNCC_EncDec.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/library/MNCC_EncDec.cc b/library/MNCC_EncDec.cc
index cdfe3ed..b4937e7 100644
--- a/library/MNCC_EncDec.cc
+++ b/library/MNCC_EncDec.cc
@@ -47,8 +47,11 @@ static MNCC__bearer__cap dec_bcap(const struct gsm_mncc_bearer_cap *in)
(GSM48__bcap__transp) in->data.transp,
(GSM48__bcap__modem__type) in->data.modem_type);
- for (unsigned int i = 0; i < ARRAY_SIZE(in->speech_ver); i++)
- vers[0] = in->speech_ver[0];
+ for (unsigned int i = 0; i < ARRAY_SIZE(in->speech_ver); i++) {
+ vers[i] = in->speech_ver[i];
+ if (vers[i] == -1)
+ break;
+ }
return MNCC__bearer__cap(in->transfer, in->mode, in->coding, in->radio, in->speech_ctm,
vers, data);