diff mbox series

[FFmpeg-devel,26/26] avfilter/vf_geq: Simplify creating string

Message ID AM7PR03MB66600D7DBF44CCA1EA597C4A8FA19@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 467c6a914629857a1085c863bc8f7d32842f8d47
Headers show
Series [FFmpeg-devel,01/26] avfilter/af_afade: Remove redundant checks and assignments
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 21, 2021, 6:27 a.m. UTC
Also fixes a Wformat-truncation warning from GCC.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/vf_geq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Paul B Mahol Sept. 21, 2021, 7:04 a.m. UTC | #1
lgtm
diff mbox series

Patch

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<<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)");