1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-03-22 20:28:58 -04:00

DATV demod: leansdr: fix possible segfaults

This commit is contained in:
f4exb 2023-04-10 11:50:30 +02:00
parent 7852ab79a6
commit a76d11b3a1
2 changed files with 10 additions and 1 deletions

View File

@ -131,6 +131,13 @@ struct cfft_engine
{
int r = bitrev[i];
if ((r < 0) || (r >= n)) // corruption: init again and exit
{
fprintf(stderr, "cfft_engine::inplace: corruption detected\n");
init(n);
return;
}
if (r < i)
{
std::complex<T> tmp = data[i];

View File

@ -357,8 +357,10 @@ struct pipewriter
void written(unsigned long n)
{
if (buf.wr + n > buf.end) {
if (buf.wr + n > buf.end)
{
fprintf(stderr, "pipewriter::written: bug: overflow to %s\n", buf.name);
return;
}
buf.wr += n;