vorbis comment list setup_malloc call is guarded

This commit is contained in:
AnthoFoxo 2021-01-25 20:01:42 -05:00
parent b038c11bd5
commit 4882970b1c

View File

@ -3643,8 +3643,10 @@ static int start_decoder(vorb *f)
f->vendor[len] = (char)'\0'; f->vendor[len] = (char)'\0';
//user comments //user comments
f->comment_list_length = get32_packet(f); 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 == NULL && f->comment_list_length > 0) return error(f, VORBIS_outofmem); 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) { for(i=0; i < f->comment_list_length; ++i) {
len = get32_packet(f); len = get32_packet(f);