Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when realloc fails #5

Open
TomArrow opened this issue Nov 12, 2021 · 1 comment
Open

Crash when realloc fails #5

TomArrow opened this issue Nov 12, 2021 · 1 comment

Comments

@TomArrow
Copy link

Here: https://github.com/chirlu/soxr/blob/master/src/vr32.c#L390

It appears that

dest = fifo_reserve(&s->fifo, len);

can return 0 if a realloc fails, but then

if (stage_num < 0) for (; i < len; ++src)
    dest[i++] = double_fir0(src), dest[i++] = double_fir1(src);

doesn't check if 0 was returned and then an access violation happens.

@Homer512
Copy link

In case it helps anyone, the likely cause of this failing is two threads using the same soxr_t handle at the same time without a mutex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants