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

CAmbisonicBinauralizer::Process() Segmentation fault (core dumped) #31

Open
Tangduf opened this issue Jun 8, 2021 · 0 comments
Open

Comments

@Tangduf
Copy link

Tangduf commented Jun 8, 2021

i want to use CAmbisonicBinauralizer::Process(), but when run code to "memcpy(ppfDst[0], m_pfScratchBufferA.data(), nSamples * sizeof(float));" it report error "Segmentation fault (core dumped)" .
i create a new file ,file name is test.c ,the code :

#include<stdio.h>
#include <stdlib.h>
#include <cstring>

int main()
{
    float **result = (float **)malloc(sizeof(float)*20);
    float test[5] = {0};
    memcpy(result[0],test, 2*sizeof(float));
    free(result);
    return 1;
}

when i run this code by comand : g++ test.c -std=c++11 or c++03 or c++17 or c++20,it also report Segmentation fault.
so we should not use "memcpy(ppfDst[0], m_pfScratchBufferA.data(), nSamples * sizeof(float));" when ppfDst type is float **,is it right?

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

1 participant