Hi, the decode step would cause ArrayIndexOutOfBoundsException sometime
private const val MAX_STACK_SIZE = 4096
private val prefix = ShortArray(MAX_STACK_SIZE)
fun decode(imageData: ByteArray, destination: ByteArray, pixelCount: Int) {
val lzwMinimumCodeSize = imageData[dataIndex]
val clear: Int = 1.shl(lzwMinimumCodeSize.toInt())
for (code in 0 until clear) {
prefix[code] = 0
suffix[code] = code.toByte()
}
once lzwMinimumCodeSize's value greater than 12, I can't make sure that gif file is corrupted or not due to it happened from my user's devices, but it is infrequent, the last report was two months ago, about 20 times totally, probably the files was broken.
just to ask if you have any idea.