mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-24 01:04:02 +02:00
Update FLAC decoder.
This commit is contained in:
+11
-5
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
FLAC audio decoder. Choice of public domain or MIT-0. See license statements at the end of this file.
|
||||
dr_flac - v0.12.18 - 2020-08-14
|
||||
dr_flac - v0.12.19 - 2020-08-30
|
||||
|
||||
David Reid - mackron@gmail.com
|
||||
|
||||
@@ -232,7 +232,7 @@ extern "C" {
|
||||
|
||||
#define DRFLAC_VERSION_MAJOR 0
|
||||
#define DRFLAC_VERSION_MINOR 12
|
||||
#define DRFLAC_VERSION_REVISION 18
|
||||
#define DRFLAC_VERSION_REVISION 19
|
||||
#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. */
|
||||
@@ -2389,7 +2389,6 @@ static DRFLAC_INLINE drflac_bool32 drflac__read_uint32(drflac_bs* bs, unsigned i
|
||||
static drflac_bool32 drflac__read_int32(drflac_bs* bs, unsigned int bitCount, drflac_int32* pResult)
|
||||
{
|
||||
drflac_uint32 result;
|
||||
drflac_uint32 signbit;
|
||||
|
||||
DRFLAC_ASSERT(bs != NULL);
|
||||
DRFLAC_ASSERT(pResult != NULL);
|
||||
@@ -2400,8 +2399,12 @@ static drflac_bool32 drflac__read_int32(drflac_bs* bs, unsigned int bitCount, dr
|
||||
return DRFLAC_FALSE;
|
||||
}
|
||||
|
||||
signbit = ((result >> (bitCount-1)) & 0x01);
|
||||
result |= (~signbit + 1) << bitCount;
|
||||
/* Do not attempt to shift by 32 as it's undefined. */
|
||||
if (bitCount < 32) {
|
||||
drflac_uint32 signbit;
|
||||
signbit = ((result >> (bitCount-1)) & 0x01);
|
||||
result |= (~signbit + 1) << bitCount;
|
||||
}
|
||||
|
||||
*pResult = (drflac_int32)result;
|
||||
return DRFLAC_TRUE;
|
||||
@@ -11769,6 +11772,9 @@ DRFLAC_API drflac_bool32 drflac_next_cuesheet_track(drflac_cuesheet_track_iterat
|
||||
/*
|
||||
REVISION HISTORY
|
||||
================
|
||||
v0.12.19 - 2020-08-30
|
||||
- Fix a bug due to an undefined 32-bit shift.
|
||||
|
||||
v0.12.18 - 2020-08-14
|
||||
- Fix a crash when compiling with clang-cl.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user