From: Michal Szczecinski Date: Wed, 9 Jun 2021 06:08:40 +0000 (+0200) Subject: evas vg: Fixed possible crash in shape interpolate. X-Git-Tag: accepted/tizen/unified/20210617.124948~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c8897a182a68aa7461f9aec1e177793dec74d723;p=platform%2Fupstream%2Fefl.git evas vg: Fixed possible crash in shape interpolate. Added ptr checks before dereference. Change-Id: I51e625a17be5cd82b30242c73c1b9d8fffb202d9 --- diff --git a/src/lib/evas/canvas/efl_canvas_vg_shape.c b/src/lib/evas/canvas/efl_canvas_vg_shape.c index 70b608c..ab6366b 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_shape.c +++ b/src/lib/evas/canvas/efl_canvas_vg_shape.c @@ -420,10 +420,14 @@ _shape_properties_interpolate(Evas_Vg_Shape *obj, Tvg_Stroke_Join join, join_to; float width, width_to; + if (!obj || !from || !to) return EINA_FALSE; + Efl_Canvas_Vg_Node_Data *nd = efl_data_scope_get(obj, EFL_CANVAS_VG_NODE_CLASS); Efl_Canvas_Vg_Node_Data *nd_from = efl_data_scope_get(from, EFL_CANVAS_VG_NODE_CLASS); Efl_Canvas_Vg_Node_Data *nd_to = efl_data_scope_get(to, EFL_CANVAS_VG_NODE_CLASS); + if (!nd || !nd_from || !nd_to) return EINA_FALSE; + nd->x = _interpolate(nd_from->x, nd_to->x, pos_map); nd->y = _interpolate(nd_from->y, nd_to->y, pos_map);