avfilter/avf_aphasemeter: check return value of ff_insert_outpad()
This commit is contained in:
parent
11fc18994e
commit
83f7a5eb62
@ -233,6 +233,7 @@ static av_cold int init(AVFilterContext *ctx)
|
|||||||
{
|
{
|
||||||
AudioPhaseMeterContext *s = ctx->priv;
|
AudioPhaseMeterContext *s = ctx->priv;
|
||||||
AVFilterPad pad;
|
AVFilterPad pad;
|
||||||
|
int ret;
|
||||||
|
|
||||||
pad = (AVFilterPad){
|
pad = (AVFilterPad){
|
||||||
.name = av_strdup("out0"),
|
.name = av_strdup("out0"),
|
||||||
@ -240,7 +241,11 @@ static av_cold int init(AVFilterContext *ctx)
|
|||||||
};
|
};
|
||||||
if (!pad.name)
|
if (!pad.name)
|
||||||
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->do_video) {
|
if (s->do_video) {
|
||||||
pad = (AVFilterPad){
|
pad = (AVFilterPad){
|
||||||
@ -250,7 +255,11 @@ static av_cold int init(AVFilterContext *ctx)
|
|||||||
};
|
};
|
||||||
if (!pad.name)
|
if (!pad.name)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
ff_insert_outpad(ctx, 1, &pad);
|
ret = ff_insert_outpad(ctx, 1, &pad);
|
||||||
|
if (ret < 0) {
|
||||||
|
av_freep(&pad.name);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user