From a9b94bd8b9fc31ba80294da1d67a6261ed7856cc Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Mon, 26 Mar 2018 20:52:27 +0200 Subject: MNCC_EncDec.cc: Fix decoding of speech versions in bearer capabilities --- titan/MNCC_EncDec.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'titan') diff --git a/titan/MNCC_EncDec.cc b/titan/MNCC_EncDec.cc index cdfe3ed..b4937e7 100644 --- a/titan/MNCC_EncDec.cc +++ b/titan/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); -- cgit v1.2.3