Skip to content
Myr

Merge branch 'stb_vorbis-fix-comment-read-oom' of https://github.com/akien-mga/stb into working

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sean Barrett · committed by Sean Barrett · parents db2acff, c24de24 · Browse files · 1 file+4 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−1 removed

  • other:+4 added−1 removed

1 file+4 added−1 removed

modified:stb_vorbis.c+4 added-1 removed
30 unmodified lines
31// Phillip Bennefall Rohit Thiago Goulart32// github:manxorist saga musix github:infatum33// Timur Gagiev Maxwell Koo Peter Waller34// github:audinowho Dougall Johnson David Reid35// github:Clownacy Pedro J. Estebanez35// github:Clownacy Pedro J. Estebanez Remi Verschelde36//37// Partial history:38// 1.19 - 2020-02-05 - warnings39// 1.18 - 2020-02-02 - fix seek bugs; parse header comments; misc warnings etc.
3593 unmodified lines
3633 if (!vorbis_validate(header)) return error(f, VORBIS_invalid_setup);3634 //file vendor3635 len = get32_packet(f);3636 f->vendor = (char*)setup_malloc(f, sizeof(char) * (len+1));3637 if (f->vendor == NULL) return error(f, VORBIS_outofmem);3638 for(i=0; i < len; ++i) {3639 f->vendor[i] = get8_packet(f);3640 }3641 f->vendor[len] = (char)'\0';3642 //user comments3643 f->comment_list_length = get32_packet(f);3644 f->comment_list = (char**)setup_malloc(f, sizeof(char*) * (f->comment_list_length));3645 if (f->comment_list == NULL) return error(f, VORBIS_outofmem);36463647 for(i=0; i < f->comment_list_length; ++i) {3648 len = get32_packet(f);3649 f->comment_list[i] = (char*)setup_malloc(f, sizeof(char) * (len+1));3650 if (f->comment_list[i] == NULL) return error(f, VORBIS_outofmem);36513652 for(j=0; j < len; ++j) {3653 f->comment_list[i][j] = get8_packet(f);3654 }
1908 unmodified lines