[gegl] gegl: make gegl_node_get_producer against invalid nodes



commit 62c89b5e5a56077a9589925d535af89aa30930cd
Author: Øyvind Kolås <pippin gimp org>
Date:   Wed May 20 20:13:12 2020 +0200

    gegl: make gegl_node_get_producer against invalid nodes
    
    During graph tear-down a crop op that has inferred dimensions will
    update its crop rect, the result-ing crop rect is not used but
    the code currently produces some criticals we can avoid by
    returning NULL when GEGL_IS_NODE is not true when expected.

 gegl/graph/gegl-node.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/gegl/graph/gegl-node.c b/gegl/graph/gegl-node.c
index 9363ef955..530338fd5 100644
--- a/gegl/graph/gegl-node.c
+++ b/gegl/graph/gegl-node.c
@@ -1786,12 +1786,19 @@ gegl_node_get_producer (GeglNode     *node,
   GeglNode *ret;
   gpointer pad;
 
+  if (!GEGL_IS_NODE (node))
+    return NULL;
+
   /* XXX: there should be public API to test if a node is
    * really a graph. So that the user of the API knows
    * the internals can be reached through the proxy nops
    */
   if (node->is_graph)
+  {
     node = gegl_node_get_input_proxy (node, "input");
+    if (!GEGL_IS_NODE (node))
+      return NULL;
+  }
 
   pad = gegl_node_get_pad (node, pad_name);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]