[Xfce4-commits] <ristretto:master> Fixed segfault

Stephan Arts stephan at xfce.org
Wed Aug 12 12:22:41 CEST 2009


Updating branch refs/heads/master
         to 50b2fe9210cdab8e3db9bb444c751fe4fc312ac4 (commit)
       from ead286a0c0dc1ea2820196a8248444b75514125c (commit)

commit 50b2fe9210cdab8e3db9bb444c751fe4fc312ac4
Author: Stephan Arts <stephan at xfce.org>
Date:   Wed Jun 3 22:34:54 2009 +0200

    Fixed segfault

 src/image_list.c     |    6 +++---
 src/image_list.h     |    6 +++---
 src/picture_viewer.c |   27 ++++++++++++++++++---------
 3 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/src/image_list.c b/src/image_list.c
index 092fcfb..11f1145 100644
--- a/src/image_list.c
+++ b/src/image_list.c
@@ -407,7 +407,7 @@ rstto_image_list_iter_get_image (RsttoImageListIter *iter)
 }
 
 
-gboolean
+void
 rstto_image_list_iter_set_position (RsttoImageListIter *iter, gint pos)
 {
     if (iter->priv->image)
@@ -420,7 +420,7 @@ rstto_image_list_iter_set_position (RsttoImageListIter *iter, gint pos)
     g_signal_emit (G_OBJECT (iter), rstto_image_list_iter_signals[RSTTO_IMAGE_LIST_ITER_SIGNAL_CHANGED], 0, NULL);
 }
 
-gboolean
+void
 rstto_image_list_iter_next (RsttoImageListIter *iter)
 {
     GList *position = NULL;
@@ -445,7 +445,7 @@ rstto_image_list_iter_next (RsttoImageListIter *iter)
     g_signal_emit (G_OBJECT (iter), rstto_image_list_iter_signals[RSTTO_IMAGE_LIST_ITER_SIGNAL_CHANGED], 0, NULL);
 }
 
-gboolean
+void
 rstto_image_list_iter_previous (RsttoImageListIter *iter)
 {
     GList *position = NULL;
diff --git a/src/image_list.h b/src/image_list.h
index cef78d3..02594da 100644
--- a/src/image_list.h
+++ b/src/image_list.h
@@ -103,10 +103,10 @@ RsttoImageListIter *rstto_image_list_get_iter (RsttoImageList *image_list);
 /** Iter functions */
 GType       rstto_image_list_get_type ();
 RsttoImage *rstto_image_list_iter_get_image (RsttoImageListIter *iter);
-gboolean    rstto_image_list_iter_previous (RsttoImageListIter *iter);
-gboolean    rstto_image_list_iter_next (RsttoImageListIter *iter);
+void        rstto_image_list_iter_previous (RsttoImageListIter *iter);
+void        rstto_image_list_iter_next (RsttoImageListIter *iter);
 gint        rstto_image_list_iter_get_position (RsttoImageListIter *iter);
-gboolean    rstto_image_list_iter_set_position (RsttoImageListIter *iter, gint pos);
+void        rstto_image_list_iter_set_position (RsttoImageListIter *iter, gint pos);
 
 void        rstto_image_list_remove_all (RsttoImageList *image_list);
 void        rstto_image_list_remove_image (RsttoImageList *image_list, RsttoImage *image);
diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index c554cf6..e8c7386 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -1154,9 +1154,12 @@ cb_rstto_picture_viewer_queued_repaint (RsttoPictureViewer *viewer)
                                                       (widget->allocation.height/ scale)*thumb_scale*image_scale:image_width*thumb_scale*image_scale),
                                                (gint)((widget->allocation.width/ scale) < image_height?
                                                       (widget->allocation.width/ scale)*image_scale*thumb_scale:image_height*thumb_scale*image_scale));
-                    p_tmp_pixbuf2 = gdk_pixbuf_rotate_simple (p_tmp_pixbuf, GDK_PIXBUF_ROTATE_CLOCKWISE);
-                    g_object_unref (p_tmp_pixbuf);
-                    p_tmp_pixbuf = p_tmp_pixbuf2;
+                    if (p_tmp_pixbuf)
+                    {
+                        p_tmp_pixbuf2 = gdk_pixbuf_rotate_simple (p_tmp_pixbuf, GDK_PIXBUF_ROTATE_CLOCKWISE);
+                        g_object_unref (p_tmp_pixbuf);
+                        p_tmp_pixbuf = p_tmp_pixbuf2;
+                    }
                     break;
                 case RSTTO_IMAGE_ORIENT_180:
                     x = (viewer->hadjustment->upper - (viewer->hadjustment->value + viewer->hadjustment->page_size)) * image_scale;
@@ -1171,9 +1174,12 @@ cb_rstto_picture_viewer_queued_repaint (RsttoPictureViewer *viewer)
                                                       (widget->allocation.width / scale)*thumb_scale*image_scale:image_width*thumb_scale*image_scale),
                                                (gint)((widget->allocation.height/ scale) < image_width?
                                                       (widget->allocation.height/ scale)*image_scale*thumb_scale:image_height*thumb_scale*image_scale));
-                    p_tmp_pixbuf2 = gdk_pixbuf_rotate_simple (p_tmp_pixbuf, GDK_PIXBUF_ROTATE_UPSIDEDOWN);
-                    g_object_unref (p_tmp_pixbuf);
-                    p_tmp_pixbuf = p_tmp_pixbuf2;
+                    if (p_tmp_pixbuf)
+                    {
+                        p_tmp_pixbuf2 = gdk_pixbuf_rotate_simple (p_tmp_pixbuf, GDK_PIXBUF_ROTATE_UPSIDEDOWN);
+                        g_object_unref (p_tmp_pixbuf);
+                        p_tmp_pixbuf = p_tmp_pixbuf2;
+                    }
                     break;
                 case RSTTO_IMAGE_ORIENT_270:
                     x = (viewer->vadjustment->upper - (viewer->vadjustment->value + viewer->vadjustment->page_size)) * image_scale;
@@ -1186,9 +1192,12 @@ cb_rstto_picture_viewer_queued_repaint (RsttoPictureViewer *viewer)
                                                       (widget->allocation.height/ scale)*thumb_scale*image_scale:image_width*thumb_scale*image_scale),
                                                (gint)((widget->allocation.width/ scale) < image_height?
                                                       (widget->allocation.width/ scale)*image_scale*thumb_scale:image_height*thumb_scale*image_scale));
-                    p_tmp_pixbuf2 = gdk_pixbuf_rotate_simple (p_tmp_pixbuf, GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE);
-                    g_object_unref (p_tmp_pixbuf);
-                    p_tmp_pixbuf = p_tmp_pixbuf2;
+                    if (p_tmp_pixbuf)
+                    {
+                        p_tmp_pixbuf2 = gdk_pixbuf_rotate_simple (p_tmp_pixbuf, GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE);
+                        g_object_unref (p_tmp_pixbuf);
+                        p_tmp_pixbuf = p_tmp_pixbuf2;
+                    }
                     break;
             }
             /**



More information about the Xfce4-commits mailing list