summaryrefslogtreecommitdiff
path: root/libavfilter/graphdump.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-08-26 13:31:06 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-08-27 18:17:04 +0200
commit76ff9640bea867a8ae5b7972faddc85eb7476222 (patch)
treed453b6641554695f754b2a71f59c73a8226792ea /libavfilter/graphdump.c
parent48348cd4aba9cdc5504e8cc7ad1562be192f61ba (diff)
avfilter/graphdump: Don't return truncated string
Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavfilter/graphdump.c')
-rw-r--r--libavfilter/graphdump.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavfilter/graphdump.c b/libavfilter/graphdump.c
index cf3296550c..099125bea8 100644
--- a/libavfilter/graphdump.c
+++ b/libavfilter/graphdump.c
@@ -159,8 +159,10 @@ char *avfilter_graph_dump(AVFilterGraph *graph, const char *options)
av_bprint_init(&buf, 0, AV_BPRINT_SIZE_COUNT_ONLY);
avfilter_graph_dump_to_buf(&buf, graph);
- av_bprint_init(&buf, buf.len + 1, buf.len + 1);
+ dump = av_malloc(buf.len + 1);
+ if (!dump)
+ return NULL;
+ av_bprint_init_for_buffer(&buf, dump, buf.len + 1);
avfilter_graph_dump_to_buf(&buf, graph);
- av_bprint_finalize(&buf, &dump);
return dump;
}