[FFmpeg-devel] [PATCH 05/25] avfilter/graphdump: Don't silently truncate channel layout string

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Fri Aug 27 17:27:05 EEST 2021


64B are not enough any more.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavfilter/graphdump.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/libavfilter/graphdump.c b/libavfilter/graphdump.c
index 22b2e21559..cf3296550c 100644
--- a/libavfilter/graphdump.c
+++ b/libavfilter/graphdump.c
@@ -30,7 +30,6 @@
 static int print_link_prop(AVBPrint *buf, AVFilterLink *link)
 {
     char *format;
-    char layout[64];
     AVBPrint dummy_buffer;
 
     if (!buf) {
@@ -47,11 +46,11 @@ static int print_link_prop(AVBPrint *buf, AVFilterLink *link)
             break;
 
         case AVMEDIA_TYPE_AUDIO:
-            av_get_channel_layout_string(layout, sizeof(layout),
-                                         link->channels, link->channel_layout);
             format = av_x_if_null(av_get_sample_fmt_name(link->format), "?");
-            av_bprintf(buf, "[%dHz %s:%s]",
-                       (int)link->sample_rate, format, layout);
+            av_bprintf(buf, "[%dHz %s:",
+                       (int)link->sample_rate, format);
+            av_bprint_channel_layout(buf, link->channels, link->channel_layout);
+            av_bprint_chars(buf, ']', 1);
             break;
 
         default:
-- 
2.30.2



More information about the ffmpeg-devel mailing list