summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorRadek Doulik <rodo@novell.com>2011-09-01 11:14:21 +0200
committerRadek Doulik <rodo@novell.com>2011-09-01 12:03:02 +0200
commitdcb9d674c898d33f1895871c38ec308a460e9400 (patch)
treecf86ebab2cf818f7eed785b0a22c7d8b06cc462b /vcl
parent62a25cad6304265689ef25fae9973f101d9fb9b7 (diff)
make sure we stay in array bounds
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk/app/gtkdata.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index b68d02335ff1..c5d12c80fb63 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -265,8 +265,10 @@ int GtkSalDisplay::GetDefaultMonitorNumber() const
gint nMonitors = gdk_screen_get_n_monitors(pScreen);
for (gint i = 0; i < nMonitors; ++i)
{
- if (g_ascii_strncasecmp (gdk_screen_get_monitor_plug_name(pScreen, i), "LVDS", 4) == 0)
- return m_aXineramaScreenIndexMap[i];
+ if (g_ascii_strncasecmp (gdk_screen_get_monitor_plug_name(pScreen, i), "LVDS", 4) == 0) {
+ OSL_ASSERT( size_t(i) < m_aXineramaScreenIndexMap.size() );
+ return (size_t(i) < m_aXineramaScreenIndexMap.size()) ? m_aXineramaScreenIndexMap[i] : 0;
+ }
}
#endif
return 0;