stb_vorbis: Fix memory leak in stb_vorbis
When start_decoder() fails it may already have allocated memory for .vendor and/or .comment_list. Call vorbis_deinit() to free any allocated memory. Fixes issue #1051.
This commit is contained in:
parent
2e3a6e8222
commit
6fe053614c
@ -33,7 +33,7 @@
|
|||||||
// Timur Gagiev Maxwell Koo Peter Waller
|
// Timur Gagiev Maxwell Koo Peter Waller
|
||||||
// github:audinowho Dougall Johnson David Reid
|
// github:audinowho Dougall Johnson David Reid
|
||||||
// github:Clownacy Pedro J. Estebanez Remi Verschelde
|
// github:Clownacy Pedro J. Estebanez Remi Verschelde
|
||||||
// AnthoFoxo
|
// AnthoFoxo github:morlat
|
||||||
//
|
//
|
||||||
// Partial history:
|
// Partial history:
|
||||||
// 1.21 - 2021-07-02 - fix bug for files with no comments
|
// 1.21 - 2021-07-02 - fix bug for files with no comments
|
||||||
@ -4513,6 +4513,7 @@ stb_vorbis *stb_vorbis_open_pushdata(
|
|||||||
*error = VORBIS_need_more_data;
|
*error = VORBIS_need_more_data;
|
||||||
else
|
else
|
||||||
*error = p.error;
|
*error = p.error;
|
||||||
|
vorbis_deinit(&p);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
f = vorbis_alloc(&p);
|
f = vorbis_alloc(&p);
|
||||||
|
Loading…
Reference in New Issue
Block a user