make sure we don't run off the end of the array

2007-08-07  Jens Granseuer  <jensgr@gmx.net>

	* gnome-theme-info.c: (read_cursor_theme): make sure we don't run off
	the end of the array

svn path=/trunk/; revision=7972
This commit is contained in:
Jens Granseuer 2007-08-07 20:16:18 +00:00 committed by Jens Granseuer
parent 69749b7dcb
commit 3d0bb8f59d
2 changed files with 9 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2007-08-07 Jens Granseuer <jensgr@gmx.net>
* gnome-theme-info.c: (read_cursor_theme): make sure we don't run off
the end of the array
2007-08-07 Jens Granseuer <jensgr@gmx.net>
* 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 <denisw@svn.gnome.org>
2007-08-04 Denis Washington <denisw@svn.gnome.org>
* gnome-theme-info.c: (read_cursor_theme), (look_for_cursor_theme):
Also load the "default" cursor theme as GnomeThemeCursorInfo so

View file

@ -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);