GTK+ 2.2.1 crashes



I think I found a bug in GTK+ 2.2.1, which will cause it to write out of
bounds when I have a pixbuf in a GtkTreeView, and part of that pixbuf is
exposed. The bug could be more general.

It's apparently been fixed on the 2.2 branch in CVS. Is this a known
bug? Does the GTK+ team have any plans for a 2.2.2 release, and if yes,
when?

I'm attaching a test case, which if you play with it a bit, should crash
or at least show some nastiness in valgrind with GTK+ 2.2.1.

-- 
Hans Petter
#include <gtk/gtk.h>

void
append_row (GtkListStore *store)
{
  GdkPixbuf   *pixbuf;
  GtkTreeIter  iter;

  pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
			   TRUE /* alpha */,
			   8 /* bits per sample */,
			   256, 16);

  gtk_list_store_append (store, &iter);
  gtk_list_store_set (store, &iter,
		      0, pixbuf,
		      -1);
}

int
main (int argc, char *argv [])
{
  GtkWindow           *window;
  GtkScrolledWindow   *scrolled;
  GtkListStore        *store;
  GtkTreeView         *view;
  GtkCellRenderer     *renderer;
  GtkTreeViewColumn   *column;

  gtk_init (&argc, &argv);

  store = gtk_list_store_new (1, GDK_TYPE_PIXBUF);
  view = GTK_TREE_VIEW (gtk_tree_view_new_with_model (GTK_TREE_MODEL (store)));

  renderer = gtk_cell_renderer_pixbuf_new ();

  column = gtk_tree_view_column_new_with_attributes ("Pixbuf", renderer,
						     "pixbuf", 0,
						     NULL);

  gtk_tree_view_append_column (view, column);
  append_row (store);

  window = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
  scrolled = gtk_scrolled_window_new (NULL, NULL);
  gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (scrolled));
  gtk_container_add (GTK_CONTAINER (scrolled), GTK_WIDGET (view));
  gtk_widget_show_all (GTK_WIDGET (window));

  gtk_main ();
}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]