From b2e8f4cd5a461b9b1f439cfe798e0d7066943b1f Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Thu, 7 Jan 2010 14:01:35 +0000 Subject: [PATCH] fix segv. SVN revision: 44948 --- src/modules/comp/e_mod_comp.c | 36 +++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/modules/comp/e_mod_comp.c b/src/modules/comp/e_mod_comp.c index ad011c31b..de0208402 100644 --- a/src/modules/comp/e_mod_comp.c +++ b/src/modules/comp/e_mod_comp.c @@ -150,7 +150,8 @@ _e_mod_comp_update_rects_get(Update *up) int ri = 0; int x, y; unsigned char *t, *t2, *t3; - + + if (!up->tiles) return NULL; r = calloc((up->tw * up->th) + 1, sizeof(Update_Rect)); if (!r) return NULL; t = up->tiles; @@ -250,23 +251,26 @@ _e_mod_comp_cb_animator(void *data) cw->update = 0; r = _e_mod_comp_update_rects_get(cw->up); - _e_mod_comp_update_clear(cw->up); - if (cw->xim) + if (r) { - for (i = 0; r[i].w > 0; i++) + _e_mod_comp_update_clear(cw->up); + if (cw->xim) { - unsigned int *pix; - int x, y, w, h; - - x = r[i].x; - y = r[i].y; - w = r[i].w; - h = r[i].h; - ecore_x_image_get(cw->xim, cw->pixmap, x, y, x, y, w, h); - pix = ecore_x_image_data_get(cw->xim, NULL, NULL, NULL); - evas_object_image_size_set(cw->obj, cw->w, cw->h); - evas_object_image_data_set(cw->obj, pix); - evas_object_image_data_update_add(cw->obj, x, y, w, h); + for (i = 0; r[i].w > 0; i++) + { + unsigned int *pix; + int x, y, w, h; + + x = r[i].x; + y = r[i].y; + w = r[i].w; + h = r[i].h; + ecore_x_image_get(cw->xim, cw->pixmap, x, y, x, y, w, h); + pix = ecore_x_image_data_get(cw->xim, NULL, NULL, NULL); + evas_object_image_size_set(cw->obj, cw->w, cw->h); + evas_object_image_data_set(cw->obj, pix); + evas_object_image_data_update_add(cw->obj, x, y, w, h); + } } } free(r);