From 5f654404d01509e684c1a1998ed8bd25dd67dae9 Mon Sep 17 00:00:00 2001 From: Taehyub Kim Date: Fri, 15 May 2020 18:09:51 +0900 Subject: [PATCH] evas_vg_shape: return NULL in evas_vg_shape_add when the parent of shape is NULL Summary: evas_vg_shaep_add should returned NULL when the parent is NULL because the function does not allow the NULL parent. @fix Reviewers: jsuya, Hermet Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11839 --- src/lib/evas/canvas/efl_canvas_vg_shape.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/efl_canvas_vg_shape.c b/src/lib/evas/canvas/efl_canvas_vg_shape.c index fb886d55df..9186c18220 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_shape.c +++ b/src/lib/evas/canvas/efl_canvas_vg_shape.c @@ -474,7 +474,12 @@ evas_vg_shape_add(Efl_Canvas_Vg_Node *parent) { /* Warn it because the usage has been changed. We can remove this message after v1.21. */ - if (!parent) CRI("Efl_Canvas_Vg_Shape only allow Efl_Canvas_Vg_Node as the parent"); + if (!parent) + { + ERR("Efl_Canvas_Vg_Shape only allow Efl_Canvas_Vg_Node as the parent"); + return NULL; + } + return efl_add(MY_CLASS, parent); }