From 8561c5fe6be8d43fcac814e8a4ebf05826cf4b5b Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 12 Apr 2006 21:20:03 +0000 Subject: [PATCH] Fix another Coverity bug --- ChangeLog | 3 +++ ChangeLog.pre-2-10 | 3 +++ gtk/gtknotebook.c | 12 +++++++----- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index e927f7c911..a209fbd881 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2006-04-12 Matthias Clasen + * gtk/gtknotebook.c (gtk_notebook_page_allocate): Reorganize + to avoid a possible NULL dereference. (Coverity) + * gdk/x11/gdkimage-x11.c (gdk_image_new_bitmap): Handle closed displays correctly. (Coverity) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index e927f7c911..a209fbd881 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,8 @@ 2006-04-12 Matthias Clasen + * gtk/gtknotebook.c (gtk_notebook_page_allocate): Reorganize + to avoid a possible NULL dereference. (Coverity) + * gdk/x11/gdkimage-x11.c (gdk_image_new_bitmap): Handle closed displays correctly. (Coverity) diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 659909a353..402d736879 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -3648,13 +3648,10 @@ gtk_notebook_page_allocate (GtkNotebook *notebook, gint focus_width; gint tab_pos = get_effective_tab_pos (notebook); - gtk_widget_style_get (widget, "focus-line-width", &focus_width, NULL); - xthickness = widget->style->xthickness; ythickness = widget->style->ythickness; page->allocation = *allocation; - gtk_widget_get_child_requisition (page->tab_label, &tab_requisition); if (notebook->cur_page != page) { @@ -3672,6 +3669,12 @@ gtk_notebook_page_allocate (GtkNotebook *notebook, break; } } + + if (!page->tab_label) + return; + + gtk_widget_style_get (widget, "focus-line-width", &focus_width, NULL); + gtk_widget_get_child_requisition (page->tab_label, &tab_requisition); switch (tab_pos) { @@ -3724,8 +3727,7 @@ gtk_notebook_page_allocate (GtkNotebook *notebook, break; } - if (page->tab_label) - gtk_widget_size_allocate (page->tab_label, &child_allocation); + gtk_widget_size_allocate (page->tab_label, &child_allocation); } static void