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

FACTAudioEngine_CreateStreamingWaveBank FACTStreamingParameters causes crash with IO on shutdown #213

Closed
alesliehughes opened this issue Sep 6, 2020 · 2 comments · Fixed by #214

Comments

@alesliehughes
Copy link
Contributor

alesliehughes commented Sep 6, 2020

IXACT3EngineImpl_CreateStreamingWaveBank which though to call FACTAudioEngine_CreateStreamingWaveBank, which we create a FACTStreamingParameters and pass that through.

This maps "fakeParms.file" as a fake wrap_readfile_struct.
So at the start of FACT_INTERNAL_ParseWaveBank, the io parameter points to a wrap_readfile_struct from wine.

Now when we shutdown FAudio, this WaveBank is destroyed, it assumes wavebank->io is a SDL_RWFromFile structure
thus calls FAudio_close. This assumption is causing a crash.

How do you think we should fix this?

FYI: FACTAudioEngine_CreateInMemoryWaveBank does't have this issue, since it uses FAudio_memopen as the a parameter.

https://bugs.winehq.org/show_bug.cgi?id=49721

@flibitijibibo
Copy link
Member

What is the line that fails?

@alesliehughes
Copy link
Contributor Author

uint32_t FACTWaveBank_Destroy(FACTWaveBank *pWaveBank)
...
FAudio_close(pWaveBank->io);

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

Successfully merging a pull request may close this issue.

2 participants