avfilter/af_anequalizer: check return value of ff_insert_outpad()
This commit is contained in:
parent
876101cf41
commit
e334765408
@ -189,6 +189,7 @@ static av_cold int init(AVFilterContext *ctx)
|
|||||||
{
|
{
|
||||||
AudioNEqualizerContext *s = ctx->priv;
|
AudioNEqualizerContext *s = ctx->priv;
|
||||||
AVFilterPad pad, vpad;
|
AVFilterPad pad, vpad;
|
||||||
|
int ret;
|
||||||
|
|
||||||
pad = (AVFilterPad){
|
pad = (AVFilterPad){
|
||||||
.name = av_strdup("out0"),
|
.name = av_strdup("out0"),
|
||||||
@ -208,10 +209,19 @@ static av_cold int init(AVFilterContext *ctx)
|
|||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
}
|
||||||
|
|
||||||
ff_insert_outpad(ctx, 0, &pad);
|
ret = ff_insert_outpad(ctx, 0, &pad);
|
||||||
|
if (ret < 0) {
|
||||||
|
av_freep(&pad.name);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
if (s->draw_curves)
|
if (s->draw_curves) {
|
||||||
ff_insert_outpad(ctx, 1, &vpad);
|
ret = ff_insert_outpad(ctx, 1, &vpad);
|
||||||
|
if (ret < 0) {
|
||||||
|
av_freep(&vpad.name);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -259,9 +269,8 @@ static av_cold void uninit(AVFilterContext *ctx)
|
|||||||
{
|
{
|
||||||
AudioNEqualizerContext *s = ctx->priv;
|
AudioNEqualizerContext *s = ctx->priv;
|
||||||
|
|
||||||
av_freep(&ctx->output_pads[0].name);
|
for (int i = 0; i < ctx->nb_outputs; i++)
|
||||||
if (s->draw_curves)
|
av_freep(&ctx->output_pads[i].name);
|
||||||
av_freep(&ctx->output_pads[1].name);
|
|
||||||
av_frame_free(&s->video);
|
av_frame_free(&s->video);
|
||||||
av_freep(&s->filters);
|
av_freep(&s->filters);
|
||||||
s->nb_filters = 0;
|
s->nb_filters = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user