Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
miniaudio
Commits
db7a3dfd
Commit
db7a3dfd
authored
Jul 03, 2021
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update stb_vorbis.
parent
4d1f619f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
extras/stb_vorbis.c
extras/stb_vorbis.c
+19
-7
No files found.
extras/stb_vorbis.c
View file @
db7a3dfd
// Ogg Vorbis audio decoder - v1.
19
- public domain
// Ogg Vorbis audio decoder - v1.
21
- public domain
// http://nothings.org/stb_vorbis/
//
// Original version written by Sean Barrett in 2007.
...
...
@@ -31,9 +31,13 @@
// 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
// AnthoFoxo
//
// Partial history:
// 1.21 - 2021-07-02 - fix bug for files with no comments
// 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 +581,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
...
...
@@ -963,7 +967,7 @@ static void *setup_temp_malloc(vorb *f, int sz)
static
void
setup_temp_free
(
vorb
*
f
,
void
*
p
,
int
sz
)
{
if
(
f
->
alloc
.
alloc_buffer
)
{
f
->
temp_offset
+=
(
sz
+
3
)
&~
3
;
f
->
temp_offset
+=
(
sz
+
7
)
&~
7
;
return
;
}
free
(
p
);
...
...
@@ -1602,7 +1606,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
;
...
...
@@ -3632,17 +3637,24 @@ static int start_decoder(vorb *f)
//file vendor
len
=
get32_packet
(
f
);
f
->
vendor
=
(
char
*
)
setup_malloc
(
f
,
sizeof
(
char
)
*
(
len
+
1
));
if
(
f
->
vendor
==
NULL
)
return
error
(
f
,
VORBIS_outofmem
);
for
(
i
=
0
;
i
<
len
;
++
i
)
{
f
->
vendor
[
i
]
=
get8_packet
(
f
);
}
f
->
vendor
[
len
]
=
(
char
)
'\0'
;
//user comments
f
->
comment_list_length
=
get32_packet
(
f
);
f
->
comment_list
=
(
char
**
)
setup_malloc
(
f
,
sizeof
(
char
*
)
*
(
f
->
comment_list_length
));
f
->
comment_list
=
NULL
;
if
(
f
->
comment_list_length
>
0
)
{
f
->
comment_list
=
(
char
**
)
setup_malloc
(
f
,
sizeof
(
char
*
)
*
(
f
->
comment_list_length
));
if
(
f
->
comment_list
==
NULL
)
return
error
(
f
,
VORBIS_outofmem
);
}
for
(
i
=
0
;
i
<
f
->
comment_list_length
;
++
i
)
{
len
=
get32_packet
(
f
);
f
->
comment_list
[
i
]
=
(
char
*
)
setup_malloc
(
f
,
sizeof
(
char
)
*
(
len
+
1
));
if
(
f
->
comment_list
[
i
]
==
NULL
)
return
error
(
f
,
VORBIS_outofmem
);
for
(
j
=
0
;
j
<
len
;
++
j
)
{
f
->
comment_list
[
i
][
j
]
=
get8_packet
(
f
);
...
...
@@ -4255,7 +4267,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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment