From 3d0bb8f59da48634d1a54044aa7c40f6f7b7dfec Mon Sep 17 00:00:00 2001 From: Jens Granseuer Date: Tue, 7 Aug 2007 20:16:18 +0000 Subject: [PATCH] make sure we don't run off the end of the array 2007-08-07 Jens Granseuer * gnome-theme-info.c: (read_cursor_theme): make sure we don't run off the end of the array svn path=/trunk/; revision=7972 --- capplets/common/ChangeLog | 7 ++++++- capplets/common/gnome-theme-info.c | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/capplets/common/ChangeLog b/capplets/common/ChangeLog index 6e0a9fe0f..4e341fd39 100644 --- a/capplets/common/ChangeLog +++ b/capplets/common/ChangeLog @@ -1,3 +1,8 @@ +2007-08-07 Jens Granseuer + + * gnome-theme-info.c: (read_cursor_theme): make sure we don't run off + the end of the array + 2007-08-07 Jens Granseuer * gnome-theme-info.c: (read_cursor_theme), @@ -5,7 +10,7 @@ too, lest we crash on free, and only unref the thumbnail if we have one -2007-07-28 Denis Washington +2007-08-04 Denis Washington * gnome-theme-info.c: (read_cursor_theme), (look_for_cursor_theme): Also load the "default" cursor theme as GnomeThemeCursorInfo so diff --git a/capplets/common/gnome-theme-info.c b/capplets/common/gnome-theme-info.c index 3e066e03c..1ca241871 100644 --- a/capplets/common/gnome-theme-info.c +++ b/capplets/common/gnome-theme-info.c @@ -1030,8 +1030,9 @@ read_cursor_theme (const gchar *theme_dir) } } - if (!thumbnail) { - cursor = XcursorLibraryLoadImage ("left_ptr", name, g_array_index (available_sizes, gint, 0)); + if (!thumbnail && available_sizes->len != 0) { + cursor = XcursorLibraryLoadImage ("left_ptr", name, + g_array_index (available_sizes, gint, 0)); if (cursor) { thumbnail = gdk_pixbuf_from_xcursor_image (cursor); XcursorImageDestroy (cursor);