From 719c2296c97082b06518905ee9a873e07beb78da Mon Sep 17 00:00:00 2001 From: zeljko Date: Sun, 4 Dec 2011 17:49:00 +0000 Subject: [PATCH] Gtk2: fixed crash on gtk2 64bit when an invalid index is passed to setPageIndex git-svn-id: trunk@33963 - --- lcl/interfaces/gtk2/gtk2pagecontrol.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lcl/interfaces/gtk2/gtk2pagecontrol.inc b/lcl/interfaces/gtk2/gtk2pagecontrol.inc index 58f8eb26ce..733eb2e13c 100644 --- a/lcl/interfaces/gtk2/gtk2pagecontrol.inc +++ b/lcl/interfaces/gtk2/gtk2pagecontrol.inc @@ -475,7 +475,8 @@ var begin if not WSCheckHandleAllocated(ATabControl, 'SetPageIndex') then Exit; - + if (AIndex < 0) or (AIndex > ATabControl.PageCount - 1) then + exit; GtkNotebook := PGtkNoteBook(ATabControl.Handle); if gtk_notebook_get_current_page(GtkNotebook) <> AIndex then begin