summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2009-03-31 20:30:50 +0000
committerFelipe Heidrich <fheidric>2009-03-31 20:30:50 +0000
commitd8b150f7916e0bed718cb1b6682bc59249791c7a (patch)
tree2cb19bf85b82c925e4e30072831bceae7f7ec3e8 /bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics
parent46582c910be397c961aaaee8545cb7afc157368f (diff)
downloadeclipse.platform.swt-d8b150f7916e0bed718cb1b6682bc59249791c7a.tar.gz
eclipse.platform.swt-d8b150f7916e0bed718cb1b6682bc59249791c7a.tar.xz
eclipse.platform.swt-d8b150f7916e0bed718cb1b6682bc59249791c7a.zip
Bug 239477: Crash in ScriptStringOut
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
index dc2db6e5a4..f45f9e3937 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
@@ -3067,7 +3067,13 @@ void shape (final int /*long*/ hdc, final StyleItem run) {
int /*long*/ metaFileDc = OS.CreateEnhMetaFile(hdc, null, null, null);
int /*long*/ oldMetaFont = OS.SelectObject(metaFileDc, hFont);
int flags = OS.SSA_METAFILE | OS.SSA_FALLBACK | OS.SSA_GLYPHS | OS.SSA_LINK;
- if (OS.ScriptStringAnalyse(metaFileDc, chars, chars.length, 0, -1, flags, 0, null, null, 0, 0, 0, ssa) == OS.S_OK) {
+ /*
+ * Bug in Uniscribe. In some version of Uniscribe, ScriptStringAnalyse crashes
+ * when the character array is too long. The fix is to limit the size of character
+ * array to two. Note, limiting the array to only one character would cause surrogate
+ * pairs to stop working.
+ */
+ if (OS.ScriptStringAnalyse(metaFileDc, chars, Math.min(chars.length, 2), 0, -1, flags, 0, null, null, 0, 0, 0, ssa) == OS.S_OK) {
OS.ScriptStringOut(ssa, 0, 0, 0, null, 0, 0, false);
OS.ScriptStringFree(ssa);
}