Browse Source

fixed vorbis comments causing outofmem

AnthoFoxo 4 years ago
parent
commit
b7b2aaa587
1 changed files with 4 additions and 2 deletions
  1. 4 2
      stb_vorbis.c

+ 4 - 2
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);