Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Nemkin2021-09-05 04:48:33 -0400
committerNiraj Modi2021-09-06 01:38:59 -0400
commit1492c73c6bc9356dddc1a4f66ca658f198bec807 (patch)
tree560505b7a51a285e6eb922e22b2e4c6bfc20e8ec
parent886b4bee462a76124a51ca7b6da8d8f6f28fb33c (diff)
downloadeclipse.platform.swt-1492c73c6bc9356dddc1a4f66ca658f198bec807.tar.gz
eclipse.platform.swt-1492c73c6bc9356dddc1a4f66ca658f198bec807.tar.xz
eclipse.platform.swt-1492c73c6bc9356dddc1a4f66ca658f198bec807.zip
Bug 575778 - Using Alpha transparency and Pattern leads to EXCEPTION_ACCESS_VIOLATION
The fix for Bug 121220 assumes that all patterns are Image-based, leading to crashes when a gradient or solid color brush is passed to TextureBrush_GetImage. Change-Id: I2bd25e15ec29cbedda6f532414c30ea5b17abd93 Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/184471 Reviewed-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com> Reviewed-by: Niraj Modi <niraj.modi@in.ibm.com> Tested-by: Niraj Modi <niraj.modi@in.ibm.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
index cdc8f3c321..a89ddf86f9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
@@ -612,6 +612,9 @@ static long createGdipFont(long hDC, long hFont, long graphics, long fontCollect
* </ul>
*/
static long createAlphaTextureBrush(long brush, int alpha) {
+ if (Gdip.Brush_GetType(brush) != Gdip.BrushTypeTextureFill) {
+ return Gdip.Brush_Clone(brush);
+ }
long hatchImage = Gdip.TextureBrush_GetImage(brush);
if (hatchImage == 0) SWT.error(SWT.ERROR_CANNOT_BE_ZERO);
long transparentHatchImage = Gdip.Image_Clone(hatchImage);

Back to the top