af_lavcac3enc: fix memory leak on 2ch audio

If processing is not required, the frame would be leaked as it is not used.
This commit is contained in:
mistraid121
2024-03-19 09:41:26 +01:00
committed by Kacper Michajłow
parent 5fea0f9a47
commit 574f269d32

View File

@@ -195,9 +195,6 @@ static void process(struct mp_filter *f)
case MP_FRAME_AUDIO:
TA_FREEP(&s->in_frame);
s->in_frame = input.data;
frame = mp_frame_to_av(input, NULL);
if (!frame)
goto error;
if (mp_aframe_get_channels(s->in_frame) < s->opts->min_channel_num) {
// Just pass it through.
s->in_frame = NULL;
@@ -208,6 +205,9 @@ static void process(struct mp_filter *f)
if (!reinit(f))
goto error;
}
frame = mp_frame_to_av(input, NULL);
if (!frame)
goto error;
break;
default: goto error; // unexpected packet type
}