mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-23 00:35:53 +08:00
Handle crashing P25 RS decoder better.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2016 by Jonathan Naylor G4KLX
|
* Copyright (C) 2016,2017 by Jonathan Naylor G4KLX
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -96,9 +96,14 @@ bool CP25Data::decodeLDU1(const unsigned char* data)
|
|||||||
CP25Utils::decode(data, raw, 1356U, 1398U);
|
CP25Utils::decode(data, raw, 1356U, 1398U);
|
||||||
decodeLDUHamming(raw, rs + 15U);
|
decodeLDUHamming(raw, rs + 15U);
|
||||||
|
|
||||||
|
try {
|
||||||
bool ret = m_rs241213.decode(rs);
|
bool ret = m_rs241213.decode(rs);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return false;
|
return false;
|
||||||
|
} catch (...) {
|
||||||
|
CUtils::dump(2U, "P25, RS carshed with input data", rs, 18U);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Simple validation of the source id
|
// Simple validation of the source id
|
||||||
unsigned int srcId = (rs[6U] << 16) + (rs[7U] << 8) + rs[8U];
|
unsigned int srcId = (rs[6U] << 16) + (rs[7U] << 8) + rs[8U];
|
||||||
|
|||||||
Reference in New Issue
Block a user