# HG changeset patch # User Thinker K.F. Li # Date 1284363199 -28800 # Node ID 387d1c597632d08310865e15c8f04d234873152c # Parent 0e56a1ca19b28e538f7efad3edd7671c3b650991 Change order of statements to fix bug of wild pointers. For some reason, the code is broken for merging from Android_Skia branch. The variable 'coord' in add_rdman_aggr_dirty_areas() is used before initialized; it is a wild pointer. diff -r 0e56a1ca19b2 -r 387d1c597632 src/redraw_man.c --- a/src/redraw_man.c Mon Sep 13 13:25:34 2010 +0800 +++ b/src/redraw_man.c Mon Sep 13 15:33:19 2010 +0800 @@ -1852,11 +1852,12 @@ n_zeroing = rdman->zeroing_coords.num; zeroings = rdman->zeroing_coords.ds; for(i = 0; i < n_zeroing; i++) { + coord = zeroings[i]; + if(coord_get_flags(coord, COF_TEMP_MARK)) continue; coord_set_flags(coord, COF_TEMP_MARK); - coord = zeroings[i]; pcached_coord = coord_get_cached(coord_get_parent(coord)); if(coord_is_root(coord) || IS_CACHE_REDRAW_ALL(pcached_coord)) @@ -2804,7 +2805,7 @@ rdman_add_shape(rdman, (shape_t *)sh, coord2); rdman_shape_changed(rdman, (shape_t *)sh); - clean_rdman_coords(rdman); + rdman_clean_dirties(rdman); /* Parent cached coord must be updated */ CU_ASSERT(_coord_get_dirty_areas(rdman->root_coord)->num >= 1);