Commit ae9449cd authored by David Reid's avatar David Reid

Update dr_mp3.

parent 40fbbdd0
/* /*
MP3 audio decoder. Choice of public domain or MIT-0. See license statements at the end of this file. 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 David Reid - mackron@gmail.com
...@@ -95,7 +95,7 @@ extern "C" { ...@@ -95,7 +95,7 @@ extern "C" {
#define DRMP3_VERSION_MAJOR 0 #define DRMP3_VERSION_MAJOR 0
#define DRMP3_VERSION_MINOR 6 #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) #define DRMP3_VERSION_STRING DRMP3_XSTRINGIFY(DRMP3_VERSION_MAJOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_MINOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_REVISION)
#include <stddef.h> /* For size_t. */ #include <stddef.h> /* For size_t. */
...@@ -2831,7 +2831,7 @@ static drmp3_bool32 drmp3_init_internal(drmp3* pMP3, drmp3_read_proc onRead, drm ...@@ -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. */ /* Decode the first frame to confirm that it is indeed a valid MP3 stream. */
if (!drmp3_decode_next_frame(pMP3)) { 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. */ return DRMP3_FALSE; /* Not a valid MP3 stream. */
} }
...@@ -4458,6 +4458,9 @@ counts rather than sample counts. ...@@ -4458,6 +4458,9 @@ counts rather than sample counts.
/* /*
REVISION HISTORY 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 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. - Fix an error where it's possible for a file handle to be left open when initialization of the decoder fails.
......
...@@ -45200,7 +45200,7 @@ extern "C" { ...@@ -45200,7 +45200,7 @@ extern "C" {
#define DRMP3_XSTRINGIFY(x) DRMP3_STRINGIFY(x) #define DRMP3_XSTRINGIFY(x) DRMP3_STRINGIFY(x)
#define DRMP3_VERSION_MAJOR 0 #define DRMP3_VERSION_MAJOR 0
#define DRMP3_VERSION_MINOR 6 #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) #define DRMP3_VERSION_STRING DRMP3_XSTRINGIFY(DRMP3_VERSION_MAJOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_MINOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_REVISION)
#include <stddef.h> #include <stddef.h>
typedef signed char drmp3_int8; typedef signed char drmp3_int8;
...@@ -63014,7 +63014,7 @@ static drmp3_bool32 drmp3_init_internal(drmp3* pMP3, drmp3_read_proc onRead, drm ...@@ -63014,7 +63014,7 @@ static drmp3_bool32 drmp3_init_internal(drmp3* pMP3, drmp3_read_proc onRead, drm
return DRMP3_FALSE; return DRMP3_FALSE;
} }
if (!drmp3_decode_next_frame(pMP3)) { if (!drmp3_decode_next_frame(pMP3)) {
drmp3_uninit(pMP3); drmp3__free_from_callbacks(pMP3->pData, &pMP3->allocationCallbacks);
return DRMP3_FALSE; return DRMP3_FALSE;
} }
pMP3->channels = pMP3->mp3FrameChannels; pMP3->channels = pMP3->mp3FrameChannels;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment