diff mbox series

[FFmpeg-devel,04/25] avfilter/graphdump: Properly initialize AVBPrint

Message ID AM7PR03MB6660218EFE2325D12D40BB838FC89@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit daeef7d220d2c62a3390a6674e8c1e08f17de85a
Headers show
Series [FFmpeg-devel,01/25] avformat/matroskadec: Fix heap-buffer overflow upon gigantic timestamps | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/configureppc warning Failed to apply patch

Commit Message

Andreas Rheinhardt Aug. 27, 2021, 2:27 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/graphdump.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/graphdump.c b/libavfilter/graphdump.c
index 79ef1a733f..22b2e21559 100644
--- a/libavfilter/graphdump.c
+++ b/libavfilter/graphdump.c
@@ -31,10 +31,12 @@  static int print_link_prop(AVBPrint *buf, AVFilterLink *link)
 {
     char *format;
     char layout[64];
-    AVBPrint dummy_buffer = { 0 };
+    AVBPrint dummy_buffer;
 
-    if (!buf)
+    if (!buf) {
         buf = &dummy_buffer;
+        av_bprint_init(buf, 0, AV_BPRINT_SIZE_COUNT_ONLY);
+    }
     switch (link->type) {
         case AVMEDIA_TYPE_VIDEO:
             format = av_x_if_null(av_get_pix_fmt_name(link->format), "?");