Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Exception java.lang.NegativeArraySizeException #4

Open
ocram opened this issue Jul 16, 2013 · 1 comment
Open

Fatal Exception java.lang.NegativeArraySizeException #4

ocram opened this issue Jul 16, 2013 · 1 comment

Comments

@ocram
Copy link

ocram commented Jul 16, 2013

I was just playing around with the Vector2[] array for PhysicsFactory.createPolygonBody() when, for some configuration, the following Exception occurred:

Fatal Exception java.lang.NegativeArraySizeException
-1087563695

RenderOfPolyFixture.java line 22
org.andengine.extension.debugdraw.RenderOfPolyFixture.<init>

DebugRenderer.java line 232
org.andengine.extension.debugdraw.DebugRenderer$RenderOfBody.<init>

DebugRenderer.java line 77
org.andengine.extension.debugdraw.DebugRenderer.onManagedUpdate

Entity.java line 1405
org.andengine.entity.Entity.onUpdate

Entity.java line 1656
org.andengine.entity.Entity.onManagedUpdate

Scene.java line 283
org.andengine.entity.scene.Scene.onManagedUpdate

Entity.java line 1405
org.andengine.entity.Entity.onUpdate

Engine.java line 611
org.andengine.engine.Engine.onUpdateScene

Engine.java line 606
org.andengine.engine.Engine.onUpdate

LimitedFPSEngine.java line 57
org.andengine.engine.LimitedFPSEngine.onUpdate

Engine.java line 568
org.andengine.engine.Engine.onTickUpdate

Engine.java line 858
org.andengine.engine.Engine$UpdateThread.run

Could this have been an overflow? The size of my array was not negative, obviously. I was just testing arrays with 6 to 12 elements.

@nazgee
Copy link
Owner

nazgee commented Jul 16, 2013

Thanks for the report!

I am not entirely sure how it's possible:

        PolygonShape fixtureShape = (PolygonShape) fixture.getShape();
        int vSize = fixtureShape.getVertexCount();
        float[] xPoints = new float[vSize]; // negative index HERE?!
        float[] yPoints = new float[vSize];

As strange as it seems... I assume that this is an issue with DebugDraw. Are you aware of any (relatively simple) way to reproduce this issue, so I can try it on my end?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants