If efl_object_override() is called with a function that does
not exist in the original class, it may lead to a crash on
indexing an non-existing array in the vtable.
This is really just a safety check, as the usage was wrong:
* You are only allowed to override functions that are defined in the
* class or any of its interfaces (that is, efl_isa returning true).
{
op_type_funcs *fsrc;
size_t idx1 = DICH_CHAIN1(op);
- Dich_Chain1 *chain1 = &vtable->chain[idx1];
+ Dich_Chain1 *chain1;
+
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(idx1 < vtable->size, EINA_FALSE);
+ chain1 = &vtable->chain[idx1];
_vtable_chain_write_prepare(chain1);
fsrc = &chain1->chain2->funcs[DICH_CHAIN_LAST(op)];
if (!allow_same_override && (fsrc->src == klass))