summaryrefslogtreecommitdiffstats
path: root/meta/packages/gtk+/gtk+-2.6.4-1.osso7/io-gif-animation.c.diff
blob: d030ae30b8ba3f84cffd1893a9af2d3131f1e5fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
--- gtk+-2.6.4/gdk-pixbuf/io-gif-animation.c	2003-06-27 05:38:43.000000000 +0300
+++ gtk+-2.6.4/gdk-pixbuf/io-gif-animation.c	2005-04-06 16:19:35.595127080 +0300
@@ -391,6 +391,11 @@
                 
                 while (tmp != NULL) {
                         GdkPixbufFrame *f = tmp->data;
+
+                        if (f->pixbuf == NULL) {
+                                return;
+                        }
+
                         gint clipped_width = MIN (gif_anim->width - f->x_offset, gdk_pixbuf_get_width (f->pixbuf));
                         gint clipped_height = MIN (gif_anim->height - f->y_offset, gdk_pixbuf_get_height (f->pixbuf));
   
@@ -414,6 +419,10 @@
                                                                 TRUE,
                                                                 8, gif_anim->width, gif_anim->height);
 
+                                if (f->composited == NULL) {
+                                        return;
+                                }
+
                                 /* alpha gets dumped if f->composited has no alpha */
                                 
                                 gdk_pixbuf_fill (f->composited,
@@ -453,9 +462,18 @@
                                 
                                 if (prev_frame->action == GDK_PIXBUF_FRAME_RETAIN) {
                                         f->composited = gdk_pixbuf_copy (prev_frame->composited);
+
+                                        if (f->composited == NULL) {
+                                                return;
+                                        }
                                         
                                 } else if (prev_frame->action == GDK_PIXBUF_FRAME_DISPOSE) {
                                         f->composited = gdk_pixbuf_copy (prev_frame->composited);
+
+                                        if (f->composited == NULL) {
+                                                return;
+                                        }
+
                                         if (prev_clipped_width > 0 && prev_clipped_height > 0) {
                                                 /* Clear area of previous frame to background */
                                                 GdkPixbuf *area;
@@ -465,6 +483,10 @@
                                                                                  prev_frame->y_offset,
                                                                                  prev_clipped_width,
                                                                                  prev_clipped_height);
+
+                                                if (area == NULL) {
+                                                        return;
+                                                }
                                                 
                                                 gdk_pixbuf_fill (area,
                                                                  (gif_anim->bg_red << 24) |
@@ -475,7 +497,13 @@
                                         }                                        
                                 } else if (prev_frame->action == GDK_PIXBUF_FRAME_REVERT) {
                                         f->composited = gdk_pixbuf_copy (prev_frame->composited);
-                                        if (prev_clipped_width > 0 && prev_clipped_height > 0) {
+
+                                        if (f->composited == NULL) {
+                                                return;
+                                        }
+
+                                        if (prev_frame->revert != NULL &&
+                                            prev_clipped_width > 0 && prev_clipped_height > 0) {
                                                 /* Copy in the revert frame */
                                                 gdk_pixbuf_copy_area (prev_frame->revert,
                                                                       0, 0,
@@ -500,14 +528,23 @@
                                                                                  f->y_offset,
                                                                                  clipped_width,
                                                                                  clipped_height);
-                                                
+                                            
+                                                if (area == NULL) {
+                                                        return;
+                                                }
+    
                                                 f->revert = gdk_pixbuf_copy (area);
-                                                
+
                                                 g_object_unref (area);
+
+                                                if (f->revert == NULL) {
+                                                        return;
+                                                }
                                         }
                                 }
 
-                                if (clipped_width > 0 && clipped_height > 0) {
+                                if (clipped_width > 0 && clipped_height > 0 &&
+                                    f->pixbuf != NULL && f->composited != NULL) {
                                         /* Put current frame onto f->composited */
                                         gdk_pixbuf_composite (f->pixbuf,
                                                               f->composited,
@@ -531,10 +568,6 @@
                         tmp = tmp->next;
                 }
         }
-
-        g_assert (frame->composited != NULL);
-        g_assert (gdk_pixbuf_get_width (frame->composited) == gif_anim->width);
-        g_assert (gdk_pixbuf_get_height (frame->composited) == gif_anim->height);
 }
 
 GdkPixbuf*