mirror of
https://github.com/mpv-player/mpv
synced 2024-12-23 07:12:39 +00:00
audio: fix audio data memory leak
Practically all audio decoding and filtering code leaked sample data memory after uninitialization due to a simple logic bug (or typo).
This commit is contained in:
parent
10bcab6bc1
commit
d0346e087a
@ -115,7 +115,7 @@ void mp_audio_set_null_data(struct mp_audio *mpa)
|
||||
static void mp_audio_destructor(void *ptr)
|
||||
{
|
||||
struct mp_audio *mpa = ptr;
|
||||
for (int n = mpa->num_planes; n < MP_NUM_CHANNELS; n++) {
|
||||
for (int n = 0; n < MP_NUM_CHANNELS; n++) {
|
||||
// Note: don't free if not allocated by mp_audio_realloc
|
||||
if (mpa->allocated[n])
|
||||
av_free(mpa->planes[n]);
|
||||
|
Loading…
Reference in New Issue
Block a user