avfilter/vf_geq: Simplify creating string

Also fixes a Wformat-truncation warning from GCC.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-09-21 08:10:49 +02:00
parent 04a5ffa75f
commit 467c6a9146

View File

@ -250,9 +250,7 @@ static av_cold int geq_init(AVFilterContext *ctx)
}
if (!geq->expr_str[A]) {
char bps_string[8];
snprintf(bps_string, sizeof(bps_string), "%d", (1<<geq->bps) - 1);
geq->expr_str[A] = av_strdup(bps_string);
geq->expr_str[A] = av_asprintf("%d", (1<<geq->bps) - 1);
}
if (!geq->expr_str[G])
geq->expr_str[G] = av_strdup("g(X,Y)");