1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avfilter/f_ebur128: check return value of ff_insert_outpad()

This commit is contained in:
Paul B Mahol 2018-09-15 21:47:48 +02:00
parent e334765408
commit 11fc18994e

View File

@ -459,6 +459,7 @@ static av_cold int init(AVFilterContext *ctx)
{ {
EBUR128Context *ebur128 = ctx->priv; EBUR128Context *ebur128 = ctx->priv;
AVFilterPad pad; AVFilterPad pad;
int ret;
if (ebur128->loglevel != AV_LOG_INFO && if (ebur128->loglevel != AV_LOG_INFO &&
ebur128->loglevel != AV_LOG_VERBOSE) { ebur128->loglevel != AV_LOG_VERBOSE) {
@ -495,7 +496,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;
}
} }
pad = (AVFilterPad){ pad = (AVFilterPad){
.name = av_asprintf("out%d", ebur128->do_video), .name = av_asprintf("out%d", ebur128->do_video),
@ -504,7 +509,11 @@ static av_cold int init(AVFilterContext *ctx)
}; };
if (!pad.name) if (!pad.name)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
ff_insert_outpad(ctx, ebur128->do_video, &pad); ret = ff_insert_outpad(ctx, ebur128->do_video, &pad);
if (ret < 0) {
av_freep(&pad.name);
return ret;
}
/* summary */ /* summary */
av_log(ctx, AV_LOG_VERBOSE, "EBU +%d scale\n", ebur128->meter); av_log(ctx, AV_LOG_VERBOSE, "EBU +%d scale\n", ebur128->meter);