mirror of
https://github.com/mpv-player/mpv
synced 2025-02-17 21:27:08 +00:00
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:
parent
5fea0f9a47
commit
574f269d32
@ -195,9 +195,6 @@ static void process(struct mp_filter *f)
|
|||||||
case MP_FRAME_AUDIO:
|
case MP_FRAME_AUDIO:
|
||||||
TA_FREEP(&s->in_frame);
|
TA_FREEP(&s->in_frame);
|
||||||
s->in_frame = input.data;
|
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) {
|
if (mp_aframe_get_channels(s->in_frame) < s->opts->min_channel_num) {
|
||||||
// Just pass it through.
|
// Just pass it through.
|
||||||
s->in_frame = NULL;
|
s->in_frame = NULL;
|
||||||
@ -208,6 +205,9 @@ static void process(struct mp_filter *f)
|
|||||||
if (!reinit(f))
|
if (!reinit(f))
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
frame = mp_frame_to_av(input, NULL);
|
||||||
|
if (!frame)
|
||||||
|
goto error;
|
||||||
break;
|
break;
|
||||||
default: goto error; // unexpected packet type
|
default: goto error; // unexpected packet type
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user