LiquidPlayer/LiquidCore

ArrayIndexOutOfBoundsException calling into javascript function

gshahbazian opened this issue · 0 comments

We have a javascript function being called many times in our application and occasionally see this exception being thrown:

     Caused by: java.lang.ArrayIndexOutOfBoundsException: src.length=126 srcPos=116 dst.length=126 dstPos=117 length=10
        at java.lang.System.arraycopy(Native Method)
        at androidx.collection.LongSparseArray.put(LongSparseArray.java:285)
        at org.liquidplayer.javascript.JNIJSValue.fromRef(JNIJSValue.java:123)
        at org.liquidplayer.javascript.JNIJSObject.fromRef(JNIJSObject.java:80)
        at org.liquidplayer.javascript.JNIJSContext.make(JNIJSContext.java:73)
        at org.liquidplayer.javascript.JSObject.<init>(JSObject.java:134)
        at org.liquidplayer.javascript.JSObject.<init>(JSObject.java:235)
        at org.liquidplayer.javascript.JSObjectPropertiesMap.<init>(JSObjectPropertiesMap.java:57)
        at org.liquidplayer.javascript.JSValue.<init>(JSValue.java:62)
        at org.liquidplayer.javascript.JSArray.<init>(JSArray.java:96)
        at org.liquidplayer.javascript.JSArray.<init>(JSArray.java:132)
        at org.liquidplayer.javascript.JSValue.<init>(JSValue.java:64)
        at org.liquidplayer.javascript.JSFunction.argsToValueRefs(JSFunction.java:393)
        at org.liquidplayer.javascript.JSFunction.apply(JSFunction.java:414)
        at org.liquidplayer.javascript.JSFunction.call(JSFunction.java:377)
...

Calling the same function with the same arguments on a re-launch of the app succeeds normally.

Is there anything here that points to something we may be doing incorrectly?