From ae9449cdbaba11ebcec900a29ff2577165e1bee7 Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 3 Dec 2020 17:49:14 +1000 Subject: [PATCH] Update dr_mp3. --- extras/dr_mp3.h | 9 ++++++--- miniaudio.h | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/extras/dr_mp3.h b/extras/dr_mp3.h index 4cea254e..b4816412 100644 --- a/extras/dr_mp3.h +++ b/extras/dr_mp3.h @@ -1,6 +1,6 @@ /* MP3 audio decoder. Choice of public domain or MIT-0. See license statements at the end of this file. -dr_mp3 - v0.6.22 - 2020-12-02 +dr_mp3 - v0.6.23 - TBD David Reid - mackron@gmail.com @@ -95,7 +95,7 @@ extern "C" { #define DRMP3_VERSION_MAJOR 0 #define DRMP3_VERSION_MINOR 6 -#define DRMP3_VERSION_REVISION 22 +#define DRMP3_VERSION_REVISION 23 #define DRMP3_VERSION_STRING DRMP3_XSTRINGIFY(DRMP3_VERSION_MAJOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_MINOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_REVISION) #include /* For size_t. */ @@ -2831,7 +2831,7 @@ static drmp3_bool32 drmp3_init_internal(drmp3* pMP3, drmp3_read_proc onRead, drm /* Decode the first frame to confirm that it is indeed a valid MP3 stream. */ if (!drmp3_decode_next_frame(pMP3)) { - drmp3_uninit(pMP3); + drmp3__free_from_callbacks(pMP3->pData, &pMP3->allocationCallbacks); /* The call above may have allocated memory. Need to make sure it's freed before aborting. */ return DRMP3_FALSE; /* Not a valid MP3 stream. */ } @@ -4458,6 +4458,9 @@ counts rather than sample counts. /* REVISION HISTORY ================ +v0.6.23 - TBD + - Fix an error where a file can be closed twice when initialization of the decoder fails. + v0.6.22 - 2020-12-02 - Fix an error where it's possible for a file handle to be left open when initialization of the decoder fails. diff --git a/miniaudio.h b/miniaudio.h index 4c371e99..47efd9e8 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -45200,7 +45200,7 @@ extern "C" { #define DRMP3_XSTRINGIFY(x) DRMP3_STRINGIFY(x) #define DRMP3_VERSION_MAJOR 0 #define DRMP3_VERSION_MINOR 6 -#define DRMP3_VERSION_REVISION 22 +#define DRMP3_VERSION_REVISION 23 #define DRMP3_VERSION_STRING DRMP3_XSTRINGIFY(DRMP3_VERSION_MAJOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_MINOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_REVISION) #include typedef signed char drmp3_int8; @@ -63014,7 +63014,7 @@ static drmp3_bool32 drmp3_init_internal(drmp3* pMP3, drmp3_read_proc onRead, drm return DRMP3_FALSE; } if (!drmp3_decode_next_frame(pMP3)) { - drmp3_uninit(pMP3); + drmp3__free_from_callbacks(pMP3->pData, &pMP3->allocationCallbacks); return DRMP3_FALSE; } pMP3->channels = pMP3->mp3FrameChannels;