mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 16:54:03 +02:00
Fix a crash when initializing a decoder without a config.
This commit is contained in:
+4
-4
@@ -50822,7 +50822,7 @@ MA_API ma_result ma_decoder_init_vfs(ma_vfs* pVFS, const char* pFilePath, const
|
|||||||
implement the same encoding format they take priority over the built-in decoders.
|
implement the same encoding format they take priority over the built-in decoders.
|
||||||
*/
|
*/
|
||||||
if (result != MA_SUCCESS) {
|
if (result != MA_SUCCESS) {
|
||||||
result = ma_decoder_init_custom__internal(pConfig, pDecoder);
|
result = ma_decoder_init_custom__internal(&config, pDecoder);
|
||||||
if (result != MA_SUCCESS) {
|
if (result != MA_SUCCESS) {
|
||||||
ma_decoder__on_seek_vfs(pDecoder, 0, ma_seek_origin_start);
|
ma_decoder__on_seek_vfs(pDecoder, 0, ma_seek_origin_start);
|
||||||
}
|
}
|
||||||
@@ -50832,7 +50832,7 @@ MA_API ma_result ma_decoder_init_vfs(ma_vfs* pVFS, const char* pFilePath, const
|
|||||||
If we get to this point and we still haven't found a decoder, and the caller has requested a
|
If we get to this point and we still haven't found a decoder, and the caller has requested a
|
||||||
specific encoding format, there's no hope for it. Abort.
|
specific encoding format, there's no hope for it. Abort.
|
||||||
*/
|
*/
|
||||||
if (pConfig->encodingFormat != ma_encoding_format_unknown) {
|
if (config.encodingFormat != ma_encoding_format_unknown) {
|
||||||
return MA_NO_BACKEND;
|
return MA_NO_BACKEND;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51028,7 +51028,7 @@ MA_API ma_result ma_decoder_init_vfs_w(ma_vfs* pVFS, const wchar_t* pFilePath, c
|
|||||||
implement the same encoding format they take priority over the built-in decoders.
|
implement the same encoding format they take priority over the built-in decoders.
|
||||||
*/
|
*/
|
||||||
if (result != MA_SUCCESS) {
|
if (result != MA_SUCCESS) {
|
||||||
result = ma_decoder_init_custom__internal(pConfig, pDecoder);
|
result = ma_decoder_init_custom__internal(&config, pDecoder);
|
||||||
if (result != MA_SUCCESS) {
|
if (result != MA_SUCCESS) {
|
||||||
ma_decoder__on_seek_vfs(pDecoder, 0, ma_seek_origin_start);
|
ma_decoder__on_seek_vfs(pDecoder, 0, ma_seek_origin_start);
|
||||||
}
|
}
|
||||||
@@ -51038,7 +51038,7 @@ MA_API ma_result ma_decoder_init_vfs_w(ma_vfs* pVFS, const wchar_t* pFilePath, c
|
|||||||
If we get to this point and we still haven't found a decoder, and the caller has requested a
|
If we get to this point and we still haven't found a decoder, and the caller has requested a
|
||||||
specific encoding format, there's no hope for it. Abort.
|
specific encoding format, there's no hope for it. Abort.
|
||||||
*/
|
*/
|
||||||
if (pConfig->encodingFormat != ma_encoding_format_unknown) {
|
if (config.encodingFormat != ma_encoding_format_unknown) {
|
||||||
return MA_NO_BACKEND;
|
return MA_NO_BACKEND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user