From 467c6a914629857a1085c863bc8f7d32842f8d47 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Tue, 21 Sep 2021 08:10:49 +0200 Subject: [PATCH] avfilter/vf_geq: Simplify creating string Also fixes a Wformat-truncation warning from GCC. Reviewed-by: Paul B Mahol Signed-off-by: Andreas Rheinhardt --- libavfilter/vf_geq.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavfilter/vf_geq.c b/libavfilter/vf_geq.c index 4a78336540..1dc59dc1fa 100644 --- a/libavfilter/vf_geq.c +++ b/libavfilter/vf_geq.c @@ -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<bps) - 1); - geq->expr_str[A] = av_strdup(bps_string); + geq->expr_str[A] = av_asprintf("%d", (1<bps) - 1); } if (!geq->expr_str[G]) geq->expr_str[G] = av_strdup("g(X,Y)");