Merge pull request #284 from juribeparada/master

Fixing occasional MMDVMHost crash when receiving P25 RF data with high BER (RS decoder fix)
This commit is contained in:
Jonathan Naylor 2017-03-21 05:40:52 +00:00 committed by GitHub
commit 9fa9206927
2 changed files with 4 additions and 3 deletions

View file

@ -241,7 +241,7 @@ bool CRS241213::decode(unsigned char* data)
if (q == 0) { //it is a root
//store root (index-form) and error location number
root[count] = i;
locn[count] = i - 1;
locn[count] = i - 40;
//if wehave max possible roots, abort search to save time
count = count + 1;
@ -317,7 +317,8 @@ bool CRS241213::decode(unsigned char* data)
// apply error to data
if (num1 != 0) {
HB[locn[j]] = HB[locn[j]] ^ (rsGFexp[(rsGFlog[num1] + rsGFlog[num2] + 63 - rsGFlog[den]) % 63]);
if(locn[j] < 24)
HB[locn[j]] = HB[locn[j]] ^ (rsGFexp[(rsGFlog[num1] + rsGFlog[num2] + 63 - rsGFlog[den]) % 63]);
}
}

View file

@ -17,7 +17,7 @@
*/
#if !defined(RS241213_H)
#define RS241213
#define RS241213_H
class CRS241213
{