summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-02-14 12:18:58 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-02-14 13:06:00 +0900
commit6642d16a7d1de17e776cf1cd8266fa2830d4b163 (patch)
treedfb3f4446f5245c302c8b2c382dafb808024d385
parentf603d5da86a5b56cdf7b4670b75755c3d0dbbc21 (diff)
Evas filters: Fix more clang stuff and add safety checks
The prepare function should not fail, unless something is very wrong. Also, return NULL instead of EINA_FALSE.
-rw-r--r--src/lib/evas/filters/evas_filter_parser.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c
index be332387ca..9c9ba04420 100644
--- a/src/lib/evas/filters/evas_filter_parser.c
+++ b/src/lib/evas/filters/evas_filter_parser.c
@@ -1246,7 +1246,7 @@ _curve_instruction_prepare(Evas_Filter_Instruction *instr)
1246 _instruction_param_name_add(instr, "src", VT_BUFFER, "input"); 1246 _instruction_param_name_add(instr, "src", VT_BUFFER, "input");
1247 _instruction_param_name_add(instr, "dst", VT_BUFFER, "output"); 1247 _instruction_param_name_add(instr, "dst", VT_BUFFER, "output");
1248 1248
1249 return EINA_FALSE; 1249 return EINA_TRUE;
1250} 1250}
1251 1251
1252static void 1252static void
@@ -1619,7 +1619,7 @@ _instruction_create(const char *name)
1619 Evas_Filter_Instruction *instr; 1619 Evas_Filter_Instruction *instr;
1620 Eina_Bool (* prepare) (Evas_Filter_Instruction *) = NULL; 1620 Eina_Bool (* prepare) (Evas_Filter_Instruction *) = NULL;
1621 1621
1622 EINA_SAFETY_ON_FALSE_RETURN_VAL(name && *name, EINA_FALSE); 1622 EINA_SAFETY_ON_FALSE_RETURN_VAL(name && *name, NULL);
1623 1623
1624 if (!strcasecmp(name, "blend")) 1624 if (!strcasecmp(name, "blend"))
1625 prepare = _blend_instruction_prepare; 1625 prepare = _blend_instruction_prepare;
@@ -1649,7 +1649,12 @@ _instruction_create(const char *name)
1649 instr = _instruction_new(name); 1649 instr = _instruction_new(name);
1650 if (!instr) return NULL; 1650 if (!instr) return NULL;
1651 1651
1652 prepare(instr); 1652 if (!prepare(instr))
1653 {
1654 CRI("Failed to prepare instruction '%s'. Check the code.", name);
1655 _instruction_del(instr);
1656 return NULL;
1657 }
1653 return instr; 1658 return instr;
1654} 1659}
1655 1660