summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-01-10 15:24:43 +0900
committerMike Blumenkrantz <zmike@samsung.com>2014-01-14 23:38:32 -0500
commit2e73c75dfaa21fb6a5cce8d98a137da3fcdd7594 (patch)
treed7853f2ae2193cc44fc3a699e6c5ca1e3bf96a98
parenta8e4d74a15e81d980dddd498bf967ceb7520243c (diff)
resolve unhandled null shape pointer
in some cases cw->shape is checked, others not. chekc in all cases. this should fix T742
-rw-r--r--src/bin/e_comp.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c
index 00bdc814e..6162a6e6f 100644
--- a/src/bin/e_comp.c
+++ b/src/bin/e_comp.c
@@ -643,7 +643,7 @@ _e_comp_win_update(E_Comp_Win *cw)
643 pw = cw->pw, ph = cw->ph; 643 pw = cw->pw, ph = cw->ph;
644 if (cw->shape_changed) 644 if (cw->shape_changed)
645 { 645 {
646 if (cw->free_shape) 646 if ((cw->shape) && (cw->free_shape))
647 { 647 {
648 ecore_x_window_geometry_get(cw->win, NULL, NULL, &(cw->w), &(cw->h)); 648 ecore_x_window_geometry_get(cw->win, NULL, NULL, &(cw->w), &(cw->h));
649 rects = (Eina_Rectangle*)ecore_x_window_shape_rectangles_get(cw->win, &num); 649 rects = (Eina_Rectangle*)ecore_x_window_shape_rectangles_get(cw->win, &num);
@@ -656,7 +656,7 @@ _e_comp_win_update(E_Comp_Win *cw)
656 e_container_shape_input_rects_set(cw->shape, rects, num); 656 e_container_shape_input_rects_set(cw->shape, rects, num);
657 } 657 }
658 } 658 }
659 if (cw->shape->shape_rects) 659 if ((cw->shape) && (cw->shape->shape_rects))
660 { 660 {
661 for (i = 0; i < cw->shape->shape_rects_num; i++) 661 for (i = 0; i < cw->shape->shape_rects_num; i++)
662 { 662 {
@@ -664,7 +664,7 @@ _e_comp_win_update(E_Comp_Win *cw)
664 cw->shape->shape_rects[i].w, cw->shape->shape_rects[i].h, 0, 0, (int)cw->w, (int)cw->h); 664 cw->shape->shape_rects[i].w, cw->shape->shape_rects[i].h, 0, 0, (int)cw->w, (int)cw->h);
665 } 665 }
666 } 666 }
667 if (cw->shape->shape_input_rects) 667 if ((cw->shape) && (cw->shape->shape_input_rects))
668 { 668 {
669 for (i = 0; i < cw->shape->shape_input_rects_num; i++) 669 for (i = 0; i < cw->shape->shape_input_rects_num; i++)
670 { 670 {
@@ -672,8 +672,11 @@ _e_comp_win_update(E_Comp_Win *cw)
672 cw->shape->shape_input_rects[i].w, cw->shape->shape_input_rects[i].h, 0, 0, (int)cw->w, (int)cw->h); 672 cw->shape->shape_input_rects[i].w, cw->shape->shape_input_rects[i].h, 0, 0, (int)cw->w, (int)cw->h);
673 } 673 }
674 } 674 }
675 cw->shaped = _e_comp_win_shaped_check(cw, cw->shape->shape_rects, cw->shape->shape_rects_num); 675 if (cw->shape)
676 evas_object_precise_is_inside_set(cw->obj, cw->shaped); 676 {
677 cw->shaped = _e_comp_win_shaped_check(cw, cw->shape->shape_rects, cw->shape->shape_rects_num);
678 evas_object_precise_is_inside_set(cw->obj, cw->shaped);
679 }
677 } 680 }
678 681
679 if (cw->dmg_updates && (((!cw->pixmap) || (cw->needpix)) && 682 if (cw->dmg_updates && (((!cw->pixmap) || (cw->needpix)) &&
@@ -943,7 +946,7 @@ _e_comp_win_update(E_Comp_Win *cw)
943 } 946 }
944 } 947 }
945 free(r); 948 free(r);
946 if (cw->shaped || cw->shape_changed) 949 if ((cw->shape) && (cw->shaped || cw->shape_changed))
947 _e_comp_win_shape_rectangles_apply(cw, cw->shape->shape_rects, cw->shape->shape_rects_num); 950 _e_comp_win_shape_rectangles_apply(cw, cw->shape->shape_rects, cw->shape->shape_rects_num);
948 cw->shape_changed = 0; 951 cw->shape_changed = 0;
949 } 952 }
@@ -2147,6 +2150,7 @@ _e_comp_win_shape_init(E_Comp_Win *cw, int w, int h)
2147{ 2150{
2148 int i; 2151 int i;
2149 2152
2153 if (!cw->shape) return;
2150 for (i = 0; i < cw->shape->shape_rects_num; i++) 2154 for (i = 0; i < cw->shape->shape_rects_num; i++)
2151 E_RECTS_CLIP_TO_RECT(cw->shape->shape_rects[i].x, cw->shape->shape_rects[i].y, 2155 E_RECTS_CLIP_TO_RECT(cw->shape->shape_rects[i].x, cw->shape->shape_rects[i].y,
2152 cw->shape->shape_rects[i].w, cw->shape->shape_rects[i].h, 0, 0, w, h); 2156 cw->shape->shape_rects[i].w, cw->shape->shape_rects[i].h, 0, 0, w, h);
@@ -2893,6 +2897,7 @@ _e_comp_win_shape_create(E_Comp_Win *cw, int x, int y, int w, int h)
2893 break; 2897 break;
2894 } 2898 }
2895 if (!cw->shape) cw->shape = e_container_shape_add(eina_list_data_get(cw->c->man->containers)); 2899 if (!cw->shape) cw->shape = e_container_shape_add(eina_list_data_get(cw->c->man->containers));
2900 if (!cw->shape) return;
2896 e_container_shape_resize(cw->shape, w, h); 2901 e_container_shape_resize(cw->shape, w, h);
2897 rects = (Eina_Rectangle*)ecore_x_window_shape_rectangles_get(cw->win, &num); 2902 rects = (Eina_Rectangle*)ecore_x_window_shape_rectangles_get(cw->win, &num);
2898 e_container_shape_rects_set(cw->shape, rects, num); 2903 e_container_shape_rects_set(cw->shape, rects, num);
@@ -2984,7 +2989,7 @@ _e_comp_hide(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
2984 if (!cw) return ECORE_CALLBACK_PASS_ON; 2989 if (!cw) return ECORE_CALLBACK_PASS_ON;
2985 if (!cw->visible) return ECORE_CALLBACK_PASS_ON; 2990 if (!cw->visible) return ECORE_CALLBACK_PASS_ON;
2986 _e_comp_win_real_hide(cw); 2991 _e_comp_win_real_hide(cw);
2987 if (cw->free_shape) e_container_shape_hide(cw->shape); 2992 if ((cw->shape) && (cw->free_shape)) e_container_shape_hide(cw->shape);
2988 return ECORE_CALLBACK_PASS_ON; 2993 return ECORE_CALLBACK_PASS_ON;
2989} 2994}
2990 2995
@@ -3038,7 +3043,7 @@ _e_comp_configure(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
3038 (cw->border == ev->border))) 3043 (cw->border == ev->border)))
3039 { 3044 {
3040 _e_comp_win_configure(cw, ev->x, ev->y, ev->w, ev->h, ev->border); 3045 _e_comp_win_configure(cw, ev->x, ev->y, ev->w, ev->h, ev->border);
3041 if (cw->free_shape) 3046 if ((cw->shape) && (cw->free_shape))
3042 { 3047 {
3043 if (cw->visible) 3048 if (cw->visible)
3044 e_container_shape_move(cw->shape, cw->x, cw->y); 3049 e_container_shape_move(cw->shape, cw->x, cw->y);