Skip to content

Commit

Permalink
stb_vorbis: revise CVE-2023-45676 / CVE-2023-45677 fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Dec 11, 2023
1 parent d372bfe commit 7cc5fec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stb_vorbis.h
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ static void *make_block_array(void *mem, int count, int size)

static void *setup_malloc(vorb *f, int sz)
{
if (sz < 0 || INT_MAX - 7 < sz) return NULL;
if (sz <= 0 || INT_MAX - 7 < sz) return NULL;
sz = (sz+7) & ~7; // round up to nearest 8 for alignment of future allocs.
f->setup_memory_required += sz;
if (f->alloc.alloc_buffer) {
Expand Down

0 comments on commit 7cc5fec

Please sign in to comment.