Fix a double-uninit error with decoders.

Public issue https://github.com/mackron/miniaudio/issues/1080
This commit is contained in:
David Reid
2026-01-04 15:03:47 +10:00
parent ad85d0c3c4
commit 88797e9dee
2 changed files with 1 additions and 24 deletions
+1
View File
@@ -1,5 +1,6 @@
v0.11.24 - TBD v0.11.24 - TBD
===================== =====================
* Fix a possible double-uninit error when a decoder fails to initialize.
* Fix a compilation error with the MSVC Aarch64 build. * Fix a compilation error with the MSVC Aarch64 build.
* Web: Fixed an error when uninitializing a context. * Web: Fixed an error when uninitializing a context.
-24
View File
@@ -66523,14 +66523,6 @@ MA_API ma_result ma_decoder_init_memory(const void* pData, size_t dataSize, cons
/* Initialization was successful. Finish up. */ /* Initialization was successful. Finish up. */
result = ma_decoder__postinit(&config, pDecoder); result = ma_decoder__postinit(&config, pDecoder);
if (result != MA_SUCCESS) { if (result != MA_SUCCESS) {
/*
The backend was initialized successfully, but for some reason post-initialization failed. This is most likely
due to an out of memory error. We're going to abort with an error here and not try to recover.
*/
if (pDecoder->pBackendVTable != NULL && pDecoder->pBackendVTable->onUninit != NULL) {
pDecoder->pBackendVTable->onUninit(pDecoder->pBackendUserData, pDecoder->pBackend, &pDecoder->allocationCallbacks);
}
return result; return result;
} }
} else { } else {
@@ -67150,14 +67142,6 @@ MA_API ma_result ma_decoder_init_file(const char* pFilePath, const ma_decoder_co
/* Initialization was successful. Finish up. */ /* Initialization was successful. Finish up. */
result = ma_decoder__postinit(&config, pDecoder); result = ma_decoder__postinit(&config, pDecoder);
if (result != MA_SUCCESS) { if (result != MA_SUCCESS) {
/*
The backend was initialized successfully, but for some reason post-initialization failed. This is most likely
due to an out of memory error. We're going to abort with an error here and not try to recover.
*/
if (pDecoder->pBackendVTable != NULL && pDecoder->pBackendVTable->onUninit != NULL) {
pDecoder->pBackendVTable->onUninit(pDecoder->pBackendUserData, pDecoder->pBackend, &pDecoder->allocationCallbacks);
}
return result; return result;
} }
} else { } else {
@@ -67300,14 +67284,6 @@ MA_API ma_result ma_decoder_init_file_w(const wchar_t* pFilePath, const ma_decod
/* Initialization was successful. Finish up. */ /* Initialization was successful. Finish up. */
result = ma_decoder__postinit(&config, pDecoder); result = ma_decoder__postinit(&config, pDecoder);
if (result != MA_SUCCESS) { if (result != MA_SUCCESS) {
/*
The backend was initialized successfully, but for some reason post-initialization failed. This is most likely
due to an out of memory error. We're going to abort with an error here and not try to recover.
*/
if (pDecoder->pBackendVTable != NULL && pDecoder->pBackendVTable->onUninit != NULL) {
pDecoder->pBackendVTable->onUninit(pDecoder->pBackendUserData, pDecoder->pBackend, &pDecoder->allocationCallbacks);
}
return result; return result;
} }
} else { } else {