# HG changeset patch # User nadvornik # Date 1232751182 0 # Node ID 09da3f14490db1eb348b9a8ce9f852b4106712c6 # Parent 8544357045549e8c9cd753537d486b0da9fffc4a fixed possible crash diff -r 854435704554 -r 09da3f14490d src/image.c --- a/src/image.c Wed Jan 21 18:30:54 2009 +0000 +++ b/src/image.c Fri Jan 23 22:53:02 2009 +0000 @@ -1003,6 +1003,10 @@ gint read_exif_for_color_profile = (imd->color_profile_enable && imd->color_profile_use_image); gint read_exif_for_orientation = FALSE; + /* read_exif and similar functions can actually notice that the file has changed and triger a notification + that removes the pixbuf from cache and unref it. Therefore we must ref it here before it is taken over by the renderer. */ + g_object_ref(pixbuf); + if (imd->image_fd && imd->image_fd->user_orientation) imd->orientation = imd->image_fd->user_orientation; else if (options->image.exif_rotate_enable) @@ -1041,6 +1045,8 @@ pixbuf_renderer_set_orientation((PixbufRenderer *)imd->pr, imd->orientation); } + g_object_unref(pixbuf); + if (imd->color_profile_enable) { if (!image_post_process_color(imd, 0, exif, FALSE))