diff options
author | Andrey Loskutov | 2018-06-18 09:22:04 +0000 |
---|---|---|
committer | Andrey Loskutov | 2018-06-18 09:22:04 +0000 |
commit | 2a350cb91ab642200a0228b2cec22cbc39cb2f40 (patch) | |
tree | 8a0cb5659fd23dbdb122adda141441cf0ea91db1 /bundles/org.eclipse.swt/Eclipse SWT | |
parent | 7cf034ab6a3722cd829e3999143a9f2600ead147 (diff) | |
download | eclipse.platform.swt-2a350cb91ab642200a0228b2cec22cbc39cb2f40.tar.gz eclipse.platform.swt-2a350cb91ab642200a0228b2cec22cbc39cb2f40.tar.xz eclipse.platform.swt-2a350cb91ab642200a0228b2cec22cbc39cb2f40.zip |
Bug 535995 - FontData.setHeight(float) allows bad values
Don't allow NaN and infinity values to be used for "height" field.
Change-Id: Ib765d4b8488932a7084c6788bf005e58e7234756
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/FontData.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/FontData.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/FontData.java index 930cba3b07..0235a64865 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/FontData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/FontData.java @@ -343,7 +343,7 @@ public void setHeight(int height) { } /*public*/ void setHeight(float height) { - if (height < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT); + if (height < 0 || Float.isNaN(height) || Float.isInfinite(height)) SWT.error(SWT.ERROR_INVALID_ARGUMENT); this.height = height; this.string = null; } |