Răsfoiți Sursa

closes #1063; Fixed files with no comments emitting outofmemory errors

AnthoFoxo 4 ani în urmă
părinte
comite
f0f2533754
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      stb_vorbis.c

+ 1 - 1
stb_vorbis.c

@@ -3643,7 +3643,7 @@ static int start_decoder(vorb *f)
    //user comments
    f->comment_list_length = get32_packet(f);
    f->comment_list = (char**)setup_malloc(f, sizeof(char*) * (f->comment_list_length));
-   if (f->comment_list == NULL)                     return error(f, VORBIS_outofmem);
+   if (f->comment_list == NULL && f->comment_list_length > 0)       return error(f, VORBIS_outofmem);
 
    for(i=0; i < f->comment_list_length; ++i) {
       len = get32_packet(f);