mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-06-02 23:12:26 -04:00
DATV demod: leansdr: fix possible segfaults
This commit is contained in:
parent
7852ab79a6
commit
a76d11b3a1
@ -131,6 +131,13 @@ struct cfft_engine
|
|||||||
{
|
{
|
||||||
int r = bitrev[i];
|
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)
|
if (r < i)
|
||||||
{
|
{
|
||||||
std::complex<T> tmp = data[i];
|
std::complex<T> tmp = data[i];
|
||||||
|
@ -357,8 +357,10 @@ struct pipewriter
|
|||||||
|
|
||||||
void written(unsigned long n)
|
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);
|
fprintf(stderr, "pipewriter::written: bug: overflow to %s\n", buf.name);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
buf.wr += n;
|
buf.wr += n;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user