From b7b2aaa587977f19bc23c853371c72e4fdd8404c Mon Sep 17 00:00:00 2001 From: AnthoFoxo Date: Tue, 13 Apr 2021 09:43:41 -0400 Subject: [PATCH] fixed vorbis comments causing outofmem --- stb_vorbis.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stb_vorbis.c b/stb_vorbis.c index 46f5370..5dff95d 100644 --- a/stb_vorbis.c +++ b/stb_vorbis.c @@ -3645,8 +3645,10 @@ static int start_decoder(vorb *f) f->comment_list_length = get32_packet(f); 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); + { + 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);