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:
wm4 2013-11-14 19:42:01 +01:00
parent 10bcab6bc1
commit d0346e087a
1 changed files with 1 additions and 1 deletions

View File

@ -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]);