diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-07-20 11:59:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-20 11:59:50 +0200 |
commit | d14932aecae5f380d766d83a8f292dd1dbf97540 (patch) | |
tree | 1f7e7f43f24f13b34312ffdd0449665e40e69dbf | |
parent | 115ad47a0cee958ddfa9a2e6845982c285a2f1e6 (diff) | |
parent | 8dffca4196ff9b7c1724d905a9114f4e332d25f6 (diff) |
Merge pull request #40536 from akien-mga/stb_vorbis-1.20
stb_vorbis: Update to upstream version 1.20
-rw-r--r-- | thirdparty/README.md | 3 | ||||
-rw-r--r-- | thirdparty/misc/stb_vorbis.c | 15 |
2 files changed, 11 insertions, 7 deletions
diff --git a/thirdparty/README.md b/thirdparty/README.md index 43cd448a00..392abea85e 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -426,9 +426,8 @@ Collection of single-file libraries used in Godot components. * License: zlib - `stb_vorbis.c` * Upstream: https://github.com/nothings/stb - * Version: 1.19 + * Version: 1.20 * License: Public Domain (Unlicense) or MIT - * Modifications: `f->temp_offset += (sz+3)&~3;` changed to `f->temp_offset += (sz+7)&~7;` (needed until fixed upstream) ## nanosvg diff --git a/thirdparty/misc/stb_vorbis.c b/thirdparty/misc/stb_vorbis.c index 52c9c666a2..a8cbfa6c23 100644 --- a/thirdparty/misc/stb_vorbis.c +++ b/thirdparty/misc/stb_vorbis.c @@ -1,4 +1,4 @@ -// Ogg Vorbis audio decoder - v1.19 - public domain +// Ogg Vorbis audio decoder - v1.20 - public domain // http://nothings.org/stb_vorbis/ // // Original version written by Sean Barrett in 2007. @@ -31,9 +31,11 @@ // Phillip Bennefall Rohit Thiago Goulart // github:manxorist saga musix github:infatum // Timur Gagiev Maxwell Koo Peter Waller -// github:audinowho Dougall Johnson +// github:audinowho Dougall Johnson David Reid +// github:Clownacy Pedro J. Estebanez Remi Verschelde // // Partial history: +// 1.20 - 2020-07-11 - several small fixes // 1.19 - 2020-02-05 - warnings // 1.18 - 2020-02-02 - fix seek bugs; parse header comments; misc warnings etc. // 1.17 - 2019-07-08 - fix CVE-2019-13217..CVE-2019-13223 (by ForAllSecure) @@ -577,7 +579,7 @@ enum STBVorbisError #if defined(_MSC_VER) || defined(__MINGW32__) #include <malloc.h> #endif - #if defined(__linux__) || defined(__linux) || defined(__EMSCRIPTEN__) + #if defined(__linux__) || defined(__linux) || defined(__EMSCRIPTEN__) || defined(__NEWLIB__) #include <alloca.h> #endif #else // STB_VORBIS_NO_CRT @@ -599,7 +601,9 @@ enum STBVorbisError #undef __forceinline #endif #define __forceinline + #ifndef alloca #define alloca __builtin_alloca + #endif #elif !defined(_MSC_VER) #if __GNUC__ #define __forceinline inline @@ -1600,7 +1604,8 @@ static uint32 get_bits(vorb *f, int n) f->valid_bits += 8; } } - if (f->valid_bits < 0) return 0; + + assert(f->valid_bits >= n); z = f->acc & ((1 << n)-1); f->acc >>= n; f->valid_bits -= n; @@ -4256,7 +4261,7 @@ static void vorbis_init(stb_vorbis *p, const stb_vorbis_alloc *z) memset(p, 0, sizeof(*p)); // NULL out all malloc'd pointers to start if (z) { p->alloc = *z; - p->alloc.alloc_buffer_length_in_bytes = (p->alloc.alloc_buffer_length_in_bytes+3) & ~3; + p->alloc.alloc_buffer_length_in_bytes &= ~7; p->temp_offset = p->alloc.alloc_buffer_length_in_bytes; } p->eof = 0; |