Closed Youlean closed 1 year ago
To clarify, is drmp3_init_*()
returning an error in this case? If it's returning false, you should not be calling drmp3_uninit()
.
Indeed drmp3_init_file does return false. Other libs don't have problems if you call uninit after the file open fails and that confused me. Maybe to have assert on uninit to warn the user?
The correct usage is to not use the object at all if initialization fails, and that applies to all other dr_libs libraries (if it works in those, it's by coincidence, not by design). Setting this one to Will Not Fix.
Maybe we can set data capacity to 0 here and check on uninit function in order to prevent the crash.
https://github.com/mackron/dr_libs/blob/056b6f5e1f7cc5046aac33e6331551b6b2813292/dr_mp3.h#L2849
Example: