[FFmpeg-cvslog] avfilter/vf_geq: Simplify creating string

Andreas Rheinhardt git at videolan.org
Tue Sep 21 19:50:35 EEST 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Tue Sep 21 08:10:49 2021 +0200| [467c6a914629857a1085c863bc8f7d32842f8d47] | committer: Andreas Rheinhardt

avfilter/vf_geq: Simplify creating string

Also fixes a Wformat-truncation warning from GCC.

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=467c6a914629857a1085c863bc8f7d32842f8d47
---

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



More information about the ffmpeg-cvslog mailing list