From: Magnus Jacobsson Date: Mon, 18 Jul 2022 15:46:01 +0000 (+0200) Subject: gvRender*: render subgraph when given, not always root graph X-Git-Tag: 5.0.1~31^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0035a5ae4cfabe3928741ae39c58964127f4f888;p=graphviz gvRender*: render subgraph when given, not always root graph These functions always rendered the root graph, even if a sub graph was given. Apart from being incorrect, this caused heap-buffer-overflow when trying to render a graph consisting of two subgraph of which only one had a layout. Also, even if both subgraphs had layouts, they somehow mixed up the bounding boxes of the graphs causing some nodes and edges not to be rendered since they were outside the graph bounding box. --- diff --git a/lib/gvc/gvc.c b/lib/gvc/gvc.c index 1df28de13..a0de4f647 100644 --- a/lib/gvc/gvc.c +++ b/lib/gvc/gvc.c @@ -85,8 +85,6 @@ int gvRender(GVC_t *gvc, graph_t *g, const char *format, FILE *out) int rc; GVJ_t *job; - g = g->root; - /* create a job for the required format */ bool r = gvjobs_output_langname(gvc, format); job = gvc->job; @@ -117,8 +115,6 @@ int gvRenderFilename(GVC_t *gvc, graph_t *g, const char *format, const char *fil int rc; GVJ_t *job; - g = g->root; - /* create a job for the required format */ bool r = gvjobs_output_langname(gvc, format); job = gvc->job; @@ -148,8 +144,6 @@ int gvRenderContext(GVC_t *gvc, graph_t *g, const char *format, void *context) int rc; GVJ_t *job; - g = g->root; - /* create a job for the required format */ bool r = gvjobs_output_langname(gvc, format); job = gvc->job; @@ -182,8 +176,6 @@ int gvRenderData(GVC_t *gvc, graph_t *g, const char *format, char **result, unsi int rc; GVJ_t *job; - g = g->root; - /* create a job for the required format */ bool r = gvjobs_output_langname(gvc, format); job = gvc->job;