1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-02 14:04:46 -04:00

SDRDaemoFEC plugin: fixed possible segfault

This commit is contained in:
f4exb
2016-12-11 14:32:10 +01:00
parent d3d6ebec89
commit abad9d7299
2 changed files with 6 additions and 0 deletions
@@ -402,6 +402,11 @@ uint8_t *SDRdaemonFECBuffer::readData(int32_t length)
m_nbReads++;
// SEGFAULT FIX: arbitratily truncate so that it does not exceed buffer length
if (length > framesSize) {
length = framesSize;
}
if (m_readIndex + length < m_framesNbBytes) // ends before buffer bound
{
m_readIndex += length;