From 228bed4c8c8ab00773151dc67ea80fe261997d3b Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Fri, 30 Aug 2019 09:17:59 -0400 Subject: [PATCH] evas_filter_parser: remove dereferenced NULL Summary: This is detected by static analysis tool. The variable last could be NULL when it is dereferenced. Reviewers: Hermet, zmike, bu5hm4n Reviewed By: zmike Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9796 --- src/lib/evas/filters/evas_filter_parser.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c index 00b231e020..264f6a6ffa 100644 --- a/src/lib/evas/filters/evas_filter_parser.c +++ b/src/lib/evas/filters/evas_filter_parser.c @@ -1405,10 +1405,16 @@ _curve_instruction_prepare(Evas_Filter_Program *pgm, Evas_Filter_Instruction *in // TODO: Allow passing an array of 256 values as points. // It could be easily computed from another function in the script. _instruction_param_seq_add(instr, "points", VT_SPECIAL, _lua_curve_points_func, NULL); - if (instr->params) last = instr->params->last; - param = EINA_INLIST_CONTAINER_GET(last, Instruction_Param); - param->allow_any_string = EINA_TRUE; - + if (instr->params) + { + last = instr->params->last; + if (last) + { + param = EINA_INLIST_CONTAINER_GET(last, Instruction_Param); + param->allow_any_string = EINA_TRUE; + } + } + _instruction_param_seq_add(instr, "interpolation", VT_STRING, "linear"); _instruction_param_seq_add(instr, "channel", VT_STRING, "rgb"); _instruction_param_name_add(instr, "src", VT_BUFFER, _buffer_get(pgm, "input"));