efx - fix unaligned ptr fill that is actually a bug

warning found a bug - filling in chr fileds with an api that expects
ptrs to ints - this is doing really bad things like unaligned writes
and it's overiting adjacent memory. fix
This commit is contained in:
Carsten Haitzler 2017-02-12 16:20:24 +09:00
parent 898a057509
commit d72815747a
1 changed files with 6 additions and 2 deletions

View File

@ -130,6 +130,7 @@ e_efx_fade(Evas_Object *obj, E_Efx_Effect_Speed speed, E_Efx_Color *ec, unsigned
{
E_EFX *e;
E_Efx_Fade_Data *efd;
int r, g, b, a;
EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
e = evas_object_data_get(obj, "e_efx-data");
@ -152,8 +153,11 @@ e_efx_fade(Evas_Object *obj, E_Efx_Effect_Speed speed, E_Efx_Color *ec, unsigned
efd->alpha[1] = alpha;
efd->cb = cb;
efd->data = (void*)data;
evas_object_color_get(efd->clip, (int*)&efd->start.r, (int*)&efd->start.g, (int*)&efd->start.b, (int*)&alpha);
efd->alpha[0] = (unsigned char)alpha;
evas_object_color_get(efd->clip, &r, &g, &b, &a);
efd->start.r = r;
efd->start.g = g;
efd->start.b = b;
efd->alpha[0] = a;
if (ec)
{
efd->color.r = ec->r;