From 9a08b3b46e7eaed4bcb116d8c1f21cbcae6cca26 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Wed, 1 Apr 2009 00:47:35 +0000 Subject: Fixed crash when setting a style that was for an index that was exactly a power of 2 and was beyond the end of the styles array. --- src/ViewStyle.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index 15efea8cc..811f79a6d 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -322,7 +322,7 @@ void ViewStyle::AllocStyles(size_t sizeNew) { void ViewStyle::EnsureStyle(size_t index) { if (index >= stylesSize) { size_t sizeNew = stylesSize * 2; - while (sizeNew < index) + while (sizeNew <= index) sizeNew *= 2; AllocStyles(sizeNew); } -- cgit v1.2.3