No method to free data allocated by mp3dec_load_buf
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- c
- Domain
- audio-video-rtc
Research direction
The allocation happens inside mp3dec_load_buf and mp3dec_load_cb in the single header minimp3.h, which fill mp3dec_file_info_t.buffer using MP3D_MALLOC; read those two functions plus the MP3D_MALLOC/MP3D_FREE macro definitions before writing anything. Add a public mp3dec_free that releases info->buffer with the matching deallocator and declare it alongside the existing API. Done means the function is exported in the header and a small example or test that decodes then frees runs without a leak; note the repo has seen no maintainer reply on this thread for years, so review may be slow.
Written by the indexing model from the issue text.
Description
mp3dec_load_buf and mp3dec_load_cb allocate some data by making a call to malloc.
There is no method for us to call to free that data.
I wrote a small function for that.
void mp3dec_free(mp3dec_file_info_t *info)
{
free((void*)info->buffer);
}
- Dominant language
- C
- Stars
- 2k
- Forks
- 271
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lieff/minimp3
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
[Bug]signed left-shift overflow in mp3dec_skip_id3v1 when parsing the APEv2 tag-size field (CWE-190)Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Integer overflow in Xing/Info VBR header parsing leads to ~10TB allocation (DoS)Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 Half a day Newbie friendliness 30/100
-
Difficulty 3/5 1-2 days Newbie friendliness 50/100
Similar issues
-
vim.filetype.match() prefixes a URL buffer name with the cwd before passing it to filetype functionsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 1 day
-
compilation errorOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
COVESA/dlt-daemon#925 · 1 reaction ·
-
stream_curl: retry_count never resets after a successful reconnect, so long sequential streams die after 5 dropsPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
mpv-player/mpv#18728 ·
Maintainers usually reply within 1 day
-
followup Prio 📌
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cyrusimap/cyrus-imapd#6640 ·
Maintainers usually reply within 2 days