shithub: mp3dec

Download patch

ref: c02ef01e1211da8eaec974b43369a0817a866b94
parent: 0757ad741707063e181fd026fc6c9975637fe3db
author: lieff <[email protected]>
date: Fri Nov 20 04:45:03 EST 2020

mp3dec_ex_close: free dec->file.buffer in MINIMP3_NO_STDIO mode

--- a/minimp3_ex.h
+++ b/minimp3_ex.h
@@ -1378,6 +1378,13 @@
 #else /* MINIMP3_NO_STDIO */
 void mp3dec_ex_close(mp3dec_ex_t *dec)
 {
+#ifdef MINIMP3_HAVE_RING
+    if (dec->io)
+        mp3dec_close_ring(&dec->file);
+#else
+    if (dec->io && dec->file.buffer)
+        free((void*)dec->file.buffer);
+#endif
     if (dec->index.frames)
         free(dec->index.frames);
     memset(dec, 0, sizeof(*dec));