Browse Source

Update dr_flac to 0.12.33

Miku AuahDark 3 years ago
parent
commit
78a915c8f4
2 changed files with 23 additions and 6 deletions
  1. 1 1
      license.txt
  2. 22 5
      src/libraries/dr_flac/dr_flac.h

+ 1 - 1
license.txt

@@ -82,7 +82,7 @@ This distribution contains code from the following projects (full license text b
 
 
  - dr_flac
  - dr_flac
 	Website: https://github.com/mackron/dr_libs
 	Website: https://github.com/mackron/dr_libs
-	Source download: https://github.com/mackron/dr_libs/blob/343aa92/dr_flac.h
+	Source download: https://github.com/mackron/dr_libs/blob/c5e5355/dr_flac.h
 	License: MIT/Expat
 	License: MIT/Expat
 	Copyright 2018 David Reid
 	Copyright 2018 David Reid
 
 

+ 22 - 5
src/libraries/dr_flac/dr_flac.h

@@ -1,6 +1,6 @@
 /*
 /*
 FLAC audio decoder. Choice of public domain or MIT-0. See license statements at the end of this file.
 FLAC audio decoder. Choice of public domain or MIT-0. See license statements at the end of this file.
-dr_flac - v0.12.29 - 2021-04-02
+dr_flac - v0.12.33 - 2021-12-22
 
 
 David Reid - [email protected]
 David Reid - [email protected]
 
 
@@ -232,7 +232,7 @@ extern "C" {
 
 
 #define DRFLAC_VERSION_MAJOR     0
 #define DRFLAC_VERSION_MAJOR     0
 #define DRFLAC_VERSION_MINOR     12
 #define DRFLAC_VERSION_MINOR     12
-#define DRFLAC_VERSION_REVISION  29
+#define DRFLAC_VERSION_REVISION  33
 #define DRFLAC_VERSION_STRING    DRFLAC_XSTRINGIFY(DRFLAC_VERSION_MAJOR) "." DRFLAC_XSTRINGIFY(DRFLAC_VERSION_MINOR) "." DRFLAC_XSTRINGIFY(DRFLAC_VERSION_REVISION)
 #define DRFLAC_VERSION_STRING    DRFLAC_XSTRINGIFY(DRFLAC_VERSION_MAJOR) "." DRFLAC_XSTRINGIFY(DRFLAC_VERSION_MINOR) "." DRFLAC_XSTRINGIFY(DRFLAC_VERSION_REVISION)
 
 
 #include <stddef.h> /* For size_t. */
 #include <stddef.h> /* For size_t. */
@@ -244,7 +244,7 @@ typedef   signed short          drflac_int16;
 typedef unsigned short          drflac_uint16;
 typedef unsigned short          drflac_uint16;
 typedef   signed int            drflac_int32;
 typedef   signed int            drflac_int32;
 typedef unsigned int            drflac_uint32;
 typedef unsigned int            drflac_uint32;
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) && !defined(__clang__)
     typedef   signed __int64    drflac_int64;
     typedef   signed __int64    drflac_int64;
     typedef unsigned __int64    drflac_uint64;
     typedef unsigned __int64    drflac_uint64;
 #else
 #else
@@ -261,7 +261,7 @@ typedef unsigned int            drflac_uint32;
         #pragma GCC diagnostic pop
         #pragma GCC diagnostic pop
     #endif
     #endif
 #endif
 #endif
-#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__)) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
+#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__)) || defined(_M_X64) || defined(__ia64) || defined(_M_IA64) || defined(__aarch64__) || defined(_M_ARM64) || defined(__powerpc64__)
     typedef drflac_uint64       drflac_uintptr;
     typedef drflac_uint64       drflac_uintptr;
 #else
 #else
     typedef drflac_uint32       drflac_uintptr;
     typedef drflac_uint32       drflac_uintptr;
@@ -6013,6 +6013,11 @@ static drflac_bool32 drflac__seek_to_pcm_frame__seek_table(drflac* pFlac, drflac
         return DRFLAC_FALSE;
         return DRFLAC_FALSE;
     }
     }
 
 
+    /* Do not use the seektable if pcmFramIndex is not coverd by it. */
+    if (pFlac->pSeekpoints[0].firstPCMFrame > pcmFrameIndex) {
+        return DRFLAC_FALSE;
+    }
+
     for (iSeekpoint = 0; iSeekpoint < pFlac->seekpointCount; ++iSeekpoint) {
     for (iSeekpoint = 0; iSeekpoint < pFlac->seekpointCount; ++iSeekpoint) {
         if (pFlac->pSeekpoints[iSeekpoint].firstPCMFrame >= pcmFrameIndex) {
         if (pFlac->pSeekpoints[iSeekpoint].firstPCMFrame >= pcmFrameIndex) {
             break;
             break;
@@ -11516,7 +11521,7 @@ static type* drflac__full_read_and_close_ ## extension (drflac* pFlac, unsigned
         DRFLAC_ZERO_MEMORY(pSampleData + (totalPCMFrameCount*pFlac->channels), (size_t)(sampleDataBufferSize - totalPCMFrameCount*pFlac->channels*sizeof(type)));   \
         DRFLAC_ZERO_MEMORY(pSampleData + (totalPCMFrameCount*pFlac->channels), (size_t)(sampleDataBufferSize - totalPCMFrameCount*pFlac->channels*sizeof(type)));   \
     } else {                                                                                                                                                        \
     } else {                                                                                                                                                        \
         drflac_uint64 dataSize = totalPCMFrameCount*pFlac->channels*sizeof(type);                                                                                   \
         drflac_uint64 dataSize = totalPCMFrameCount*pFlac->channels*sizeof(type);                                                                                   \
-        if (dataSize > DRFLAC_SIZE_MAX) {                                                                                                                           \
+        if (dataSize > (drflac_uint64)DRFLAC_SIZE_MAX) {                                                                                                            \
             goto on_error;  /* The decoded data is too big. */                                                                                                      \
             goto on_error;  /* The decoded data is too big. */                                                                                                      \
         }                                                                                                                                                           \
         }                                                                                                                                                           \
                                                                                                                                                                     \
                                                                                                                                                                     \
@@ -11851,6 +11856,18 @@ DRFLAC_API drflac_bool32 drflac_next_cuesheet_track(drflac_cuesheet_track_iterat
 /*
 /*
 REVISION HISTORY
 REVISION HISTORY
 ================
 ================
+v0.12.33 - 2021-12-22
+  - Fix a bug with seeking when the seek table does not start at PCM frame 0.
+
+v0.12.32 - 2021-12-11
+  - Fix a warning with Clang.
+
+v0.12.31 - 2021-08-16
+  - Silence some warnings.
+
+v0.12.30 - 2021-07-31
+  - Fix platform detection for ARM64.
+
 v0.12.29 - 2021-04-02
 v0.12.29 - 2021-04-02
   - Fix a bug where the running PCM frame index is set to an invalid value when over-seeking.
   - Fix a bug where the running PCM frame index is set to an invalid value when over-seeking.
   - Fix a decoding error due to an incorrect validation check.
   - Fix a decoding error due to an incorrect validation check.