diff options
author | Shinwoo Kim <cinoo.kim@samsung.com> | 2019-08-30 09:17:59 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@samsung.com> | 2019-08-30 14:47:22 -0400 |
commit | 228bed4c8c8ab00773151dc67ea80fe261997d3b (patch) | |
tree | 6fac7d03dee4f591d51e68ee3eaac973d4eee4a1 | |
parent | 41a9ce67a9fad7a98ce8aa6da4e8e72d75c8bec0 (diff) | |
download | efl-228bed4c8c8ab00773151dc67ea80fe261997d3b.tar.gz |
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
-rw-r--r-- | src/lib/evas/filters/evas_filter_parser.c | 14 |
1 files 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")); |