This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository efl.

View the commit online.

commit 26965df5ae86f017c890e252fbf7a55a89514af5
Author: Cedric BAIL <[email protected]>
AuthorDate: Sun Nov 15 17:40:38 2026 -0600

    evas:filters: do not abort when the color class cannot be loaded
    
    When the color class could not be loaded, _lua_state_create() logged
    an error and returned the Lua state anyway. Setting up the program's
    state then indexes the missing "color" global outside of any
    protected call, and Lua panics: the whole process aborts on
    "unprotected error in call to Lua API".
    
    Any installation or in-tree run where evas cannot find its
    filters/lua directory hits this as soon as a filter is parsed, for
    instance from a theme. Returning NULL makes the parse fail, and the
    object renders unfiltered.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 src/lib/evas/filters/evas_filter_parser.c |  7 ++++++-
 src/tests/evas/evas_test_filters.c        | 15 +++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c
index 9a8537849a..39c61f4cdb 100644
--- a/src/lib/evas/filters/evas_filter_parser.c
+++ b/src/lib/evas/filters/evas_filter_parser.c
@@ -2568,7 +2568,12 @@ _lua_state_create(Evas_Filter_Program *pgm)
 
    // Load color class
    if (!_lua_import_class(L, _lua_color_meta, &_lua_color_code))
-     ERR("Could not load color class!");
+     {
+        ERR("Could not load color class!");
+        lua_close(L);
+        pgm->L = NULL;
+        return NULL;
+     }
 
    return L;
 }
diff --git a/src/tests/evas/evas_test_filters.c b/src/tests/evas/evas_test_filters.c
index 71713390d8..75728411e2 100644
--- a/src/tests/evas/evas_test_filters.c
+++ b/src/tests/evas/evas_test_filters.c
@@ -498,10 +498,25 @@ EFL_START_TEST(evas_filter_state_test)
 }
 EFL_END_TEST
 
+EFL_START_TEST(evas_filter_parser_missing_lua_classes)
+{
+   Evas_Filter_Program *pgm;
+
+   setenv("EFL_EVAS_FILTER_LUA_PREFIX", TESTS_BUILD_DIR "/no-such-dir", 1);
+
+   pgm = evas_filter_program_new("evas_suite", EINA_TRUE);
+   ck_assert(!evas_filter_program_parse(pgm, "blend()"));
+   evas_filter_program_del(pgm);
+
+   unsetenv("EFL_EVAS_FILTER_LUA_PREFIX");
+}
+EFL_END_TEST
+
 void evas_test_filters(TCase *tc)
 {
    tcase_add_test(tc, evas_filter_parser);
    tcase_add_test(tc, evas_filter_text_padding_test);
    tcase_add_test(tc, evas_filter_text_render_test);
    tcase_add_test(tc, evas_filter_state_test);
+   tcase_add_test(tc, evas_filter_parser_missing_lua_classes);
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to