Skip to content

patch miniaudio#2833

Closed
mercury233 wants to merge 2 commits into
Fluorohydride:masterfrom
mercury233:patch-patch-miniaudio
Closed

patch miniaudio#2833
mercury233 wants to merge 2 commits into
Fluorohydride:masterfrom
mercury233:patch-patch-miniaudio

Conversation

@mercury233

Copy link
Copy Markdown
Collaborator

Problem:
Crash when using wetype IME (微信输入法), Use-After-Free when using sogou IME (搜狗输入法)

Solution:
Apply mackron/miniaudio#968 before miniaudio release a new version.


Another solution: define MA_NO_WASAPI as workaround

@purerosefallen

purerosefallen commented Jun 9, 2025

Copy link
Copy Markdown
Collaborator

DON'T use patch.
plz fork miniaudio and change repo path, just as how irrlicht did

@edo9300

edo9300 commented Jun 9, 2025

Copy link
Copy Markdown
Contributor

You should define the MA_COINIT_VALUE macro and put the same value used by irrlicht

@mercury233

mercury233 commented Jun 9, 2025

Copy link
Copy Markdown
Collaborator Author

You should define the MA_COINIT_VALUE macro and put the same value used by irrlicht

Both my irrlicht fork and the original irrlicht 1.9 don't have CIrrDeviceWin32WindowsVersionWMI.cpp which is in your version.

And miniaudio is using COINIT_MULTITHREADED as default.

#ifndef MA_COINIT_VALUE
#define MA_COINIT_VALUE    0   /* 0 = COINIT_MULTITHREADED */
#endif

@edo9300

edo9300 commented Jun 9, 2025

Copy link
Copy Markdown
Contributor

You should define the MA_COINIT_VALUE macro and put the same value used by irrlicht

Both my irrlicht fork and the original irrlicht 1.9 don't have CIrrDeviceWin32WindowsVersionWMI.cpp which is in your version.

And miniaudio is using COINIT_MULTITHREADED as default.

#ifndef MA_COINIT_VALUE
#define MA_COINIT_VALUE    0   /* 0 = COINIT_MULTITHREADED */
#endif

In my case the call actually setting up COM is OleInitialize, which sets it to apartment threaded, (in the file you pointed out com is de initialized after the function si executed). My guess is that the ime handling is internally initializing COM with that specific threading model beforehand.

@purerosefallen

Copy link
Copy Markdown
Collaborator

#2840
I believe this to be better. patch is strange all the time.

@mercury233

Copy link
Copy Markdown
Collaborator Author

I don't think so. Fork repo may cause problem such as #2815 (comment)

@purerosefallen

Copy link
Copy Markdown
Collaborator

I don't think so. Fork repo may cause problem such as #2815 (comment)

We can avoid by telling the related repo commit / PR in our PR description.

However, patch is even harder to maintain, and sometimes the patch may fail with no reasons.

@mercury233 mercury233 closed this Jun 19, 2025
@mercury233 mercury233 mentioned this pull request Dec 3, 2025
@mercury233 mercury233 deleted the patch-patch-miniaudio branch December 3, 2025 05:37
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 this pull request may close these issues.

3 participants