Login  Register

Crash in WindowsAWTWGLGraphicsConfigurationFactory

Posted by Lathanda on Jun 14, 2020; 1:21pm
URL: https://forum.jogamp.org/Crash-in-WindowsAWTWGLGraphicsConfigurationFactory-tp4040703.html

opengl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationImpl(WindowsAWTWGLGraphicsConfigurationFactory.java:171

Source from
https://github.com/JogAmp/jogl/blob/master/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java

Sourcecode:
170:               if( 0 > gcIdx ) {
171:                    chosenGC = configs[gcIdx];

The condition ensures that gcIdx is negative. Using a negative index on an array will always crash.

Is there a workaround or a bug fix?

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 1
        at jogamp.fat/jogamp.opengl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationImpl(WindowsAWTWGLGraphicsConfigurationFactory.java:171)
        at jogamp.fat/com.jogamp.nativewindow.GraphicsConfigurationFactory.chooseGraphicsConfiguration(GraphicsConfigurationFactory.java:424)
        at jogamp.fat/com.jogamp.opengl.awt.GLCanvas.chooseGraphicsConfiguration(GLCanvas.java:1513)
        at jogamp.fat/com.jogamp.opengl.awt.GLCanvas.addNotify(GLCanvas.java:609)
        at java.desktop/java.awt.Container.addNotify(Container.java:2800)
        at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4783)
        at java.desktop/java.awt.Container.addNotify(Container.java:2800)
        at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4783)
        at java.desktop/java.awt.Container.addNotify(Container.java:2800)
        at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4783)
        at java.desktop/javax.swing.JRootPane.addNotify(JRootPane.java:729)
        at java.desktop/java.awt.Container.addNotify(Container.java:2800)
        at java.desktop/java.awt.Window.addNotify(Window.java:778)
        at java.desktop/java.awt.Frame.addNotify(Frame.java:490)
        at java.desktop/java.awt.Window.pack(Window.java:816)