Reverting all the dbus related commits (sigh) from 27th July and fixing a QA issue...
[oespirit1] / gtkhtml / gtkhtml_280_pop_element_by_type_crash_fix.diff
1 2009-03-20 08:54 diff -lru gtkhtml-3.24.4/gtkhtml/htmlengine.c gtkhtml-3.24.4-fix_crash_dkedves/gtkhtml/htmlengine.c Page 1
2 --- gtkhtml-3.24.4/gtkhtml/htmlengine.c 2009-03-20 08:54:09.000000000 +0100
3 +++ gtkhtml-3.24.4/gtkhtml/htmlengine.c 2009-03-19 21:38:46.000000000 +0100
4 @@ -1137,17 +1137,22 @@
5
6         while (l) {
7                 gint cd;
8 -               elem = l->data;
9 -
10 -               cd = elem->style->display;
11 -               if (cd == display)
12 -                       break;
13  
14 -               if (cd > maxLevel) {
15 -                       if (display != DISPLAY_INLINE
16 -                           || cd > DISPLAY_BLOCK)
17 -                               return;
18 -               }
19 +        /* We skip invalid items to avoid crash...
20 +         * Yeah, its only a workaround... FIXME */
21 +        if (l->data && ((HTMLElement*)l->data)->style) {
22 +               elem = l->data;
23 +    
24 +               cd = elem->style->display;
25 +                   if (cd == display)
26 +                       break;
27 +    
28 +               if (cd > maxLevel) {
29 +                           if (display != DISPLAY_INLINE
30 +                           || cd > DISPLAY_BLOCK)
31 +                               return;
32 +               }
33 +        }
34  
35                 l = l->next;
36         }
37