From 5bb15a8edc558b82758dc10b40a52e21d18b48eb Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 23 Jul 2020 18:57:53 +1000 Subject: [PATCH] Update dr_mp3. --- extras/dr_mp3.h | 12 +++++++++--- miniaudio.h | 6 ++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/extras/dr_mp3.h b/extras/dr_mp3.h index 82938df7..eb66f437 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.13 - 2020-07-06 +dr_mp3 - v0.6.14 - 2020-07-23 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 13 +#define DRMP3_VERSION_REVISION 14 #define DRMP3_VERSION_STRING DRMP3_XSTRINGIFY(DRMP3_VERSION_MAJOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_MINOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_REVISION) #include /* For size_t. */ @@ -2653,7 +2653,10 @@ static drmp3_uint32 drmp3_decode_next_frame_ex__callbacks(drmp3* pMP3, drmp3d_sa size_t bytesRead; /* First we need to move the data down. */ - memmove(pMP3->pData, pMP3->pData + pMP3->dataConsumed, pMP3->dataSize); + if (pMP3->pData != NULL) { + memmove(pMP3->pData, pMP3->pData + pMP3->dataConsumed, pMP3->dataSize); + } + pMP3->dataConsumed = 0; if (pMP3->dataCapacity < DRMP3_DATA_CHUNK_SIZE) { @@ -4428,6 +4431,9 @@ counts rather than sample counts. /* REVISION HISTORY ================ +v0.6.14 - 2020-07-23 + - Fix undefined behaviour with memmove(). + v0.6.13 - 2020-07-06 - Fix a bug when converting from s16 to f32 in drmp3_read_pcm_frames_f32(). diff --git a/miniaudio.h b/miniaudio.h index 23b75469..d9939078 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -42957,7 +42957,7 @@ extern "C" { #define DRMP3_XSTRINGIFY(x) DRMP3_STRINGIFY(x) #define DRMP3_VERSION_MAJOR 0 #define DRMP3_VERSION_MINOR 6 -#define DRMP3_VERSION_REVISION 13 +#define DRMP3_VERSION_REVISION 14 #define DRMP3_VERSION_STRING DRMP3_XSTRINGIFY(DRMP3_VERSION_MAJOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_MINOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_REVISION) #include #ifdef _MSC_VER @@ -60418,7 +60418,9 @@ static drmp3_uint32 drmp3_decode_next_frame_ex__callbacks(drmp3* pMP3, drmp3d_sa drmp3dec_frame_info info; if (pMP3->dataSize < DRMP3_MIN_DATA_CHUNK_SIZE) { size_t bytesRead; - memmove(pMP3->pData, pMP3->pData + pMP3->dataConsumed, pMP3->dataSize); + if (pMP3->pData != NULL) { + memmove(pMP3->pData, pMP3->pData + pMP3->dataConsumed, pMP3->dataSize); + } pMP3->dataConsumed = 0; if (pMP3->dataCapacity < DRMP3_DATA_CHUNK_SIZE) { drmp3_uint8* pNewData;